Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: LPC1114_Deep_Power_Down NOKIA_5110 mbed
Revision 2:f925ff712f53, committed 2015-01-24
- 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 |
--- 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);
+ }
}