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: MMA8452 N5110 PowerControl beep mbed
Diff: Accel-cize.cpp
- Revision:
- 8:aebb468546c5
- Parent:
- 7:95abf8c8af1e
- Child:
- 9:522f9311ff4b
--- a/Accel-cize.cpp Fri May 08 02:11:03 2015 +0000
+++ b/Accel-cize.cpp Sat May 09 22:59:15 2015 +0000
@@ -14,34 +14,31 @@
ButtonD.rise(&BuDPress);
ButtonA.rise(&BuAPress);
ButtonB.rise(&BuBPress);
- wel.welcome();
+
+ wel.welcome();
debounce.start();
+
while(1) {
lcd.setBrightness(adjust);
program.proact();
//////// Timer for the mbed go to sleep mode when waiting for 2 mins ////////
- /*resetButton();
- if ((BuAFlag || BuBFlag || BuDFlag || BuUFlag) == 0) {
+
+ if ((BuAFlag==0) && (BuBFlag==0) && (BuDFlag==0) && (BuUFlag==0)) {
t.start();
float time = t.read();
char buffer[14];
sprintf(buffer,"Time: %0.1f",time);
lcd.printString(buffer,0,5);
}
- if (t.read() < 10 && (BuAFlag || BuBFlag || BuDFlag || BuUFlag) > 1) {
- t.reset();
- t.start();
- resetButton();
- } else if(t.read() > 10 && (BuAFlag || BuBFlag || BuDFlag || BuUFlag) == 0) {
- lcd.setBrightness(0);
- t.stop();
+ if ((BuAFlag)||(BuBFlag)||(BuUFlag)||(BuDFlag)) {
t.reset();
- sleep();
- if ((BuAFlag || BuBFlag || BuDFlag || BuUFlag) > 1) {
- resetButton();
- }
- }*/
+ }
+ if (t.read()>10) {
+ lcd.setBrightness(0);
+ t.reset();
+ Sleep();
+ }
}
-}
\ No newline at end of file
+}