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-04
- Revision:
- 3:1974db5993ef
- Child:
- 5:c0a58a6916f2
File content as of revision 3:1974db5993ef:
#include "MMA8452Test.h"
#include "PowerControl/PowerControl.h"
#include "GameFSM.h"
AnalogIn adjust(p20);
Timer t;
FSM program;
int main()
{
Test init;
init.initial();
ButtonU.rise(&BuUPress);
ButtonD.rise(&BuDPress);
ButtonA.rise(&BuAPress);
ButtonB.rise(&BuBPress);
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) {
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();
t.reset();
sleep();
if ((BuAFlag || BuBFlag || BuDFlag || BuUFlag) > 1) {
resetButton();
}
}*/
}
}