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
Accel-cize.cpp
- Committer:
- stevenle93
- Date:
- 2015-05-09
- Revision:
- 8:aebb468546c5
- Parent:
- 7:95abf8c8af1e
- Child:
- 9:522f9311ff4b
File content as of revision 8:aebb468546c5:
#include "MMA8452Test.h"
#include "GameFSM.h"
AnalogIn adjust(p20);
Timer t;
FSM program;
Menu wel;
int main()
{
Test init;
init.initial();
ButtonU.rise(&BuUPress);
ButtonD.rise(&BuDPress);
ButtonA.rise(&BuAPress);
ButtonB.rise(&BuBPress);
wel.welcome();
debounce.start();
while(1) {
lcd.setBrightness(adjust);
program.proact();
//////// Timer for the mbed go to sleep mode when waiting for 2 mins ////////
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 ((BuAFlag)||(BuBFlag)||(BuUFlag)||(BuDFlag)) {
t.reset();
}
if (t.read()>10) {
lcd.setBrightness(0);
t.reset();
Sleep();
}
}
}