A retro gaming programme, designed for use on a portable embedded system. Incorporates power saving techniques.
Dependencies: ConfigFile N5110 PowerControl beep mbed
Diff: main.cpp
- Revision:
- 65:c5dad703f752
- Parent:
- 64:715fb5a1e58b
- Child:
- 66:d5174aa5839d
--- a/main.cpp Thu May 07 16:41:53 2015 +0000 +++ b/main.cpp Fri May 08 05:13:38 2015 +0000 @@ -753,7 +753,6 @@ refreshCursor2(); } } - lcd.refresh(); } @@ -832,7 +831,6 @@ } } } - lcd.refresh(); } @@ -1292,6 +1290,11 @@ printFlag = 1; } +void screenOff(){ + + lcd.setBrightness(0.0); + } + int main() { ledP = 1;//power LED on @@ -1315,6 +1318,9 @@ timerA.attach(&timerExpiredA, 0.1);//checks state of buttonA timerB.attach(&timerExpiredB, 0.1);//checks state of buttonB + + if((!buttonFlagA)||(!buttonFlagB)||(!printFlag)){ + standby.attach(&screenOff,);} while(1) { drawMainMenu();//draws main menu