Giter Club home page Giter Club logo

asrockm8oledcontroller's Introduction

ASRockM8OledController

This library is designed to allow users to draw data to and receive input from the OLED dial controller on the front of the ASRock M8 barebones system.

There is still a significant amount of work to be done on the library, specifically around attribute settings and providing controls for things like case lights.

I haven't tested this in Mono yet, but I'm guessing it's dependent on getting the USB HID interface to work; it's fairly easy to slot in and out, but if I find one that's cross-platform between .NET and Mono, I'll switch to that. Right now I'm using UsbHid.

I'm redistributing UsbHid.dll because I can't remember where I got it or what the license is. If you own it, please let me know if I'm infringing on your license and I'll be happy to take it down and point to your website instead.

If you're using this, please let me know! I always appreciate hearing people use this. This project is under the Apache v2 license, which can be found in LICENSE.txt.

A demo of all the supported draw procedures can be found at https://www.youtube.com/watch?v=uA-hNJLAK6c . This includes the new color techology.

** All images sent to the draw routines must be 96x96px to match the size of the OLED display **

Sample Code

Displaying a GIF

var oledController = new LibOLEDController.OledController();
var imageDecode = new GifBitmapDecoder(new Uri("mygif.gif"), BitmapCreateOptions.None, BitmapCacheOption.OnLoad);
foreach (var frame in imageDecode.Frames)
  oledController.DrawMono(OledMonoImage.DitheringMethod.FloydSteinberg, frame);

Catching Input

var oledController = new LibOLEDController.OledController();
oledController.InputReceived += type =>
{
  switch (type)
  {
    case OledController.UserInputType.ButtonPushed:
      Console.WriteLine("User pushed button on the front");
      break;
    case OledController.UserInputType.ChassisRotated:
      Console.WriteLine("User rotated the chassis 90 degrees");
      break;
    case OledController.UserInputType.DialTurnedLeft:
      Console.WriteLine("User turned the dial to the left one click");
      break;
    case OledController.UserInputType.DialTurnedRight:
      Console.WriteLine("User turned the dial to the right one click");
      break;
  }
};

asrockm8oledcontroller's People

Contributors

anthturner avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.