AirsoftTimer software based on mbed
Dependencies: mbed TextLCD keypad
board/Keyboard.h@19:2eba101d9c2c, 2015-05-23 (annotated)
- Committer:
- sillevl
- Date:
- Sat May 23 22:42:51 2015 +0000
- Revision:
- 19:2eba101d9c2c
- Parent:
- 18:abcebc4d0da0
game selector working (solved strange behaviour with buttonEvent and lcd commands)
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
sillevl | 4:2c91c9eccf3a | 1 | #ifndef KEYBOARD_H |
sillevl | 4:2c91c9eccf3a | 2 | #define KEYBOARD_H |
sillevl | 4:2c91c9eccf3a | 3 | |
sillevl | 4:2c91c9eccf3a | 4 | #include "mbed.h" |
sillevl | 11:50572814f73e | 5 | #include "Keypad.h" |
sillevl | 4:2c91c9eccf3a | 6 | |
sillevl | 4:2c91c9eccf3a | 7 | struct KeyboardPins{ |
sillevl | 4:2c91c9eccf3a | 8 | PinName rows[4]; |
sillevl | 4:2c91c9eccf3a | 9 | PinName cols[3]; |
sillevl | 4:2c91c9eccf3a | 10 | }; |
sillevl | 4:2c91c9eccf3a | 11 | |
sillevl | 11:50572814f73e | 12 | |
sillevl | 11:50572814f73e | 13 | |
sillevl | 11:50572814f73e | 14 | class Keyboard : public Keypad{ |
sillevl | 4:2c91c9eccf3a | 15 | public: |
sillevl | 11:50572814f73e | 16 | Keyboard(KeyboardPins keyboardPins); |
sillevl | 11:50572814f73e | 17 | |
sillevl | 11:50572814f73e | 18 | template<class T> |
sillevl | 11:50572814f73e | 19 | void attach(T* item, uint32_t(T::*method)(uint32_t)){ |
sillevl | 11:50572814f73e | 20 | _callback.attach(item, method); |
sillevl | 11:50572814f73e | 21 | } |
sillevl | 11:50572814f73e | 22 | |
sillevl | 11:50572814f73e | 23 | static const char KEYTABLE[]; |
sillevl | 11:50572814f73e | 24 | |
sillevl | 11:50572814f73e | 25 | private: |
sillevl | 4:2c91c9eccf3a | 26 | |
sillevl | 4:2c91c9eccf3a | 27 | }; |
sillevl | 4:2c91c9eccf3a | 28 | |
sillevl | 4:2c91c9eccf3a | 29 | #endif |