QuickClick, a reaction timing game which allows single and multiplayer mode.
Dependencies: Controller Display N5110 Operator mbed
Diff: main.cpp
- Revision:
- 5:b6fcee26c5ff
- Parent:
- 3:e67f9ba37049
- Child:
- 6:e7510e120617
--- a/main.cpp Fri Apr 14 23:43:44 2017 +0000 +++ b/main.cpp Sat Apr 15 15:40:05 2017 +0000 @@ -1,5 +1,3 @@ -//Dom - #include "mbed.h" #include "N5110.h" #include "Display.h" @@ -23,7 +21,7 @@ starter(); while(1) { instruction_val = Opp.random_instruction(display, lcd); - display.drawCircle(lcd); + display.drawCircle(pad, lcd); button_val = Opp.read_input(pad); pad.leds_off(); if (button_val == instruction_val) { @@ -37,14 +35,14 @@ } } + void starter() { - + lcd.clear(); lcd.printString("Quick Click",10,1); lcd.printString("Start >",24,4); lcd.refresh(); - - // wait flashing LEDs until start button is pressed + while (pad.check_event(Controller::START_PRESSED) == false) { pad.leds_on(); wait(0.1);