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-08
- Revision:
- 7:95abf8c8af1e
- Parent:
- 5:c0a58a6916f2
- Child:
- 8:aebb468546c5
File content as of revision 7:95abf8c8af1e:
#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 //////// /*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(); } }*/ } }