1D-Pong game based on a LED strip with 150 LPD6803-controlled pixels. Game keeps score for 'best-of-21' game. Written for KL25Z
GameButton.h@23:861ceaca2518, 2013-08-27 (annotated)
- Committer:
- vsluiter
- Date:
- Tue Aug 27 21:22:14 2013 +0000
- Revision:
- 23:861ceaca2518
- Parent:
- 21:a554229e884b
- Child:
- 26:448ee3b0b481
Updated scoring (indicates who's winning) and updated EOG / scoring with new game
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
vsluiter | 21:a554229e884b | 1 | #ifndef _GAMEBUTTON_H_ |
vsluiter | 21:a554229e884b | 2 | #define _GAMEBUTTON_H_ |
vsluiter | 21:a554229e884b | 3 | |
vsluiter | 21:a554229e884b | 4 | #include "mbed.h" |
vsluiter | 21:a554229e884b | 5 | class GameButton |
vsluiter | 21:a554229e884b | 6 | { |
vsluiter | 21:a554229e884b | 7 | public: |
vsluiter | 21:a554229e884b | 8 | GameButton(){}; |
vsluiter | 21:a554229e884b | 9 | GameButton(PinName pin, float time); |
vsluiter | 21:a554229e884b | 10 | bool pushflag; |
vsluiter | 21:a554229e884b | 11 | bool getTimeoutActive(void); |
vsluiter | 21:a554229e884b | 12 | protected: |
vsluiter | 21:a554229e884b | 13 | virtual void pushhandlercallback(void){}; |
vsluiter | 21:a554229e884b | 14 | private: |
vsluiter | 21:a554229e884b | 15 | InterruptIn *intpin; |
vsluiter | 21:a554229e884b | 16 | Timeout timeout; |
vsluiter | 21:a554229e884b | 17 | float m_time; |
vsluiter | 21:a554229e884b | 18 | bool m_timeoutactive; |
vsluiter | 21:a554229e884b | 19 | void TimeOutHandler(void); |
vsluiter | 21:a554229e884b | 20 | virtual void PushHandler(void); |
vsluiter | 21:a554229e884b | 21 | }; |
vsluiter | 21:a554229e884b | 22 | |
vsluiter | 21:a554229e884b | 23 | |
vsluiter | 21:a554229e884b | 24 | #endif |