Simple Simon says mbed game which makes random queue, shows it with onboard LEDs and takes user input with push buttons.
Dependencies: PinDetect mbed beep
Piezo.h@5:94c215df2b7c, 2015-02-10 (annotated)
- Committer:
- tsoic
- Date:
- Tue Feb 10 12:37:56 2015 +0000
- Revision:
- 5:94c215df2b7c
- Parent:
- 4:32b02dd83c0d
Added piezo speaker and sound effects
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
tsoic | 4:32b02dd83c0d | 1 | #ifndef PIEZO_H |
tsoic | 4:32b02dd83c0d | 2 | #define PIEZO_H |
tsoic | 4:32b02dd83c0d | 3 | #include "mbed.h" |
tsoic | 4:32b02dd83c0d | 4 | #include "beep.h" |
tsoic | 4:32b02dd83c0d | 5 | #include <vector> |
tsoic | 4:32b02dd83c0d | 6 | |
tsoic | 4:32b02dd83c0d | 7 | class Piezo { |
tsoic | 4:32b02dd83c0d | 8 | public: |
tsoic | 4:32b02dd83c0d | 9 | void NoteC4() { piezo.beep(261.63, 0.4); }; |
tsoic | 4:32b02dd83c0d | 10 | void NoteE4() { piezo.beep(329.63, 0.4); }; |
tsoic | 4:32b02dd83c0d | 11 | void NoteG4() { piezo.beep(392.00, 0.4); }; |
tsoic | 4:32b02dd83c0d | 12 | void NoteB4() { piezo.beep(493.88, 0.4); }; |
tsoic | 4:32b02dd83c0d | 13 | void NoteFor(int); |
tsoic | 4:32b02dd83c0d | 14 | private: |
tsoic | 4:32b02dd83c0d | 15 | static Beep piezo; |
tsoic | 4:32b02dd83c0d | 16 | }; |
tsoic | 4:32b02dd83c0d | 17 | |
tsoic | 4:32b02dd83c0d | 18 | #endif |