Demonstrates the use of the LPC1114_Deep_Power_Down library with the NOKIA_5110 library

Dependencies:   LPC1114_Deep_Power_Down NOKIA_5110 mbed

Files at this revision

API Documentation at this revision

Comitter:
bundgus
Date:
Sat Jan 24 21:55:34 2015 +0000
Parent:
1:118bef2666a8
Commit message:
updated backlight behavior

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
diff -r 118bef2666a8 -r f925ff712f53 main.cpp
--- a/main.cpp	Tue Jan 13 04:33:15 2015 +0000
+++ b/main.cpp	Sat Jan 24 21:55:34 2015 +0000
@@ -16,17 +16,17 @@
 
 // high-level hardware interfaces
 DeepPowerDown pd;
+DigitalOut backlight(dp18, 0);
 LcdPins myLcdPins = { dp2, NC, dp6, dp26, dp25, dp24 };  // mosi, miso, sclk, dc, sce, rst
 NokiaLcd myLcd( myLcdPins );
-DigitalOut backlight(dp14);
 AnalogIn vref(dp9);
 AnalogIn vbat(dp10);
 DigitalIn personPIR(dp11);
 
 void startup()
 {
-    // Turn on LCD Backlight
-    backlight = 1;
+    // Turn off LCD Backlight
+    backlight = 0;
 
     // Start the LCD
     myLcd.InitLcd();
@@ -110,8 +110,12 @@
     myLcd.DrawString(gpreg0_c);
     myLcd.DrawString("v");
 
-    wait_ms(10000);
-
+	for (int i=0;i<50;i++){
+	if (persondetected == 0) {
+	backlight = !backlight;
+    }
+    wait_ms(100);
+	}
 
 }