Philip Walne
/
335_project
Dotstar LED demonstration, with stacker game. Uses 2 buttons, and LPC1768 microcontroller
light_game.h@1:37200a0da529, 2017-01-04 (annotated)
- Committer:
- pwalne
- Date:
- Wed Jan 04 20:55:18 2017 +0000
- Revision:
- 1:37200a0da529
- Parent:
- 0:9ab173ff6353
Working version with DotStar LED
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
pwalne | 0:9ab173ff6353 | 1 | /** |
pwalne | 0:9ab173ff6353 | 2 | * A abstract base class of a light game. This might not even be a light game, but rather a demonstration. |
pwalne | 0:9ab173ff6353 | 3 | * |
pwalne | 0:9ab173ff6353 | 4 | * |
pwalne | 0:9ab173ff6353 | 5 | */ |
pwalne | 0:9ab173ff6353 | 6 | #ifndef _LIGHT_GAME_H |
pwalne | 0:9ab173ff6353 | 7 | #define _LIGHT_GAME_H |
pwalne | 0:9ab173ff6353 | 8 | |
pwalne | 0:9ab173ff6353 | 9 | #include <./DotStar/DotStar.h> |
pwalne | 0:9ab173ff6353 | 10 | #include "mbed.h" |
pwalne | 0:9ab173ff6353 | 11 | |
pwalne | 0:9ab173ff6353 | 12 | Serial pc1(USBTX, USBRX); |
pwalne | 0:9ab173ff6353 | 13 | |
pwalne | 0:9ab173ff6353 | 14 | class Light_Game { |
pwalne | 0:9ab173ff6353 | 15 | public: |
pwalne | 0:9ab173ff6353 | 16 | Light_Game() {} |
pwalne | 0:9ab173ff6353 | 17 | virtual void init() {pc1.printf("NOOO");} |
pwalne | 0:9ab173ff6353 | 18 | virtual void update() {} |
pwalne | 0:9ab173ff6353 | 19 | virtual void btn1() {} |
pwalne | 0:9ab173ff6353 | 20 | virtual void btn2() {} |
pwalne | 0:9ab173ff6353 | 21 | void end() {} |
pwalne | 0:9ab173ff6353 | 22 | virtual bool isFinished() { return false;} |
pwalne | 0:9ab173ff6353 | 23 | }; |
pwalne | 0:9ab173ff6353 | 24 | |
pwalne | 0:9ab173ff6353 | 25 | Adafruit_DotStar strip(30, p11, p12); |
pwalne | 0:9ab173ff6353 | 26 | #endif |