AirsoftTimer software based on mbed

Dependencies:   mbed TextLCD keypad

Committer:
sillevl
Date:
Sun May 24 21:09:30 2015 +0000
Revision:
25:a26b2ec5ab72
Parent:
24:f0989eca7469
Child:
27:f29805113454
prevent WaitForKeyObjective from continuously refreshing the screen

Who changed what in which revision?

UserRevisionLine numberNew contents of line
sillevl 13:ece97a1108cc 1
sillevl 13:ece97a1108cc 2 #include "WaitForKeyObjective.h"
sillevl 24:f0989eca7469 3 #include "../games/Game.h"
sillevl 13:ece97a1108cc 4
sillevl 14:e0bfee0a5e66 5 WaitForKeyObjective::WaitForKeyObjective(Game* game) : Objective(game){
sillevl 25:a26b2ec5ab72 6 //keyboard->attach(this, &WaitForKeyObjective::buttonEvent);
sillevl 14:e0bfee0a5e66 7 }
sillevl 14:e0bfee0a5e66 8
sillevl 13:ece97a1108cc 9 void WaitForKeyObjective::run(){
sillevl 19:2eba101d9c2c 10 lcd->cls();
sillevl 25:a26b2ec5ab72 11 lcd->printf("press any key");
sillevl 25:a26b2ec5ab72 12 lcd->locate(0,1);
sillevl 25:a26b2ec5ab72 13 lcd->printf("to continue...");
sillevl 25:a26b2ec5ab72 14
sillevl 25:a26b2ec5ab72 15 //wait until completed
sillevl 25:a26b2ec5ab72 16 while(getStatus() != COMPLETED){}
sillevl 15:78116b7254d5 17 }
sillevl 15:78116b7254d5 18
sillevl 16:e8e96bf22df1 19 void WaitForKeyObjective::buttonEvent(char c){
sillevl 16:e8e96bf22df1 20 // complete objective if a button is pressed
sillevl 15:78116b7254d5 21 complete();
sillevl 13:ece97a1108cc 22 }