Library for Modtronix im4OLED board with 128x64 OLED and 4 buttons. For details, see product page http://modtronix.com/im4oled.html. Is a clone of Adafruit_GFX library, with some additional code added.
Fork of Adafruit_GFX by
Diff: im4oled.h
- Revision:
- 18:cad3dec05e0d
- Child:
- 19:15282c12e577
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/im4oled.h Fri Jul 24 18:15:12 2015 +1000 @@ -0,0 +1,50 @@ +#include "mbed.h" + +typedef struct { + union { + struct { + uint8_t fallingLatch :1; + uint8_t risingLatch :1; + } bit; + uint8_t Val; + } flags; +} ButtonFlags; + + +class im4OLED { +public: + im4OLED(PinName pinOK, PinName pinStar, PinName pinUp, PinName pinDown); + + int getOkBtn(); + int getStarBtn(); + int getUpBtn(); + int getDownBtn(); + +// int getOkBtnRissing(); +// int getStarBtnRissing(); +// int getUpBtnRissing(); +// int getDownBtnRissing(); + + int getBtnFalling(uint16_t btnID); + + int getOkBtnFalling(); + int getStarBtnFalling(); + int getUpBtnFalling(); + int getDownBtnFalling(); + +private : + // objects + Ticker _ticker; + + DigitalIn btnOK; + DigitalIn btnStar; + DigitalIn btnUp; + DigitalIn btnDown; + + uint8_t arrButtons[4]; //OK, Star, Up, Down + uint8_t arrBtnFalling[4]; //OK, Star, Up, Down + ButtonFlags arrBtnFlags[4]; + + // function to take a sample, and update flags + void _sample(void); +};