A retro gaming programme, designed for use on a portable embedded system. Incorporates power saving techniques.

Dependencies:   ConfigFile N5110 PowerControl beep mbed

Files at this revision

API Documentation at this revision

Comitter:
el13drt
Date:
Fri May 08 05:13:38 2015 +0000
Parent:
64:715fb5a1e58b
Child:
66:d5174aa5839d
Commit message:
fix brightness

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
tower.h Show annotated file Show diff for this revision Revisions of this file
--- 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
--- a/tower.h	Thu May 07 16:41:53 2015 +0000
+++ b/tower.h	Fri May 08 05:13:38 2015 +0000
@@ -51,6 +51,13 @@
 Ticker pollJoystick;
 
 /**
+@namespace standby
+@brief Calls the function.........
+*/
+Ticker standby;
+
+
+/**
 @namespace buzzer
 @brief Object of the beep class, allocates a pin to the Piezo buzzer.
 */