A simple Simon Says game using a Grove Base Shield, 3 Grove LED Bars, 1 Grove Buzzer, and 3 Grove Buttons.
Components Used
Platform: ST-Nucleo-F401RE
Component Configuration
LED_Bar mid(D6, D5); //D5 LED_Bar right(D8, D7); //D7 LED_Bar left(D4, D3); //D3 InterruptIn button_left(A2); InterruptIn button_mid(A1); InterruptIn button_right(A0); DigitalOut buzzer(D2);
Gallery
Diff: main.cpp
- Revision:
- 10:9d48af13dbd0
- Parent:
- 9:ac887bf9f85d
- Child:
- 11:2307c5edf18f
--- a/main.cpp Fri Aug 19 15:24:12 2016 +0000
+++ b/main.cpp Fri Aug 19 15:27:17 2016 +0000
@@ -12,8 +12,9 @@
int input[100];
bool start_flag = false;
+/* start the game: animation/buzzer sounds */
void start_level() {
- for(int i = 0; i < 2; i++) {
+ for(int i = 0; i < 3; i++) {
right.setLevel(10);
mid.setLevel(10);
left.setLevel(10);
Jenny Plunkett
