Lights the barrery LED one-by-one, in an interval of 0.5 seconds. When button A is pressed, the LEDS hold.
Revision 3:d57fdbf06ac8, committed 2016-02-27
- Comitter:
- NoamVH
- Date:
- Sat Feb 27 14:11:59 2016 +0000
- Parent:
- 2:61a8e97a0875
- Child:
- 4:7bb8fce3cdd6
- Commit message:
- Foramtted.
Changed in this revision
| main.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/main.cpp Sat Feb 27 14:02:15 2016 +0000
+++ b/main.cpp Sat Feb 27 14:11:59 2016 +0000
@@ -1,7 +1,8 @@
#include "mbed.h"
#include "TFC.h"
-int main() {
+int main()
+{
TFC_Init(); //Initiate the TFC
int i=0; //Set counter to 0
for(;;) { // Loop start
@@ -12,10 +13,10 @@
else //If button 0 is NOT pressed
TFC_SetBatteryLED_Level(i);
- wait(0.5);
- if(i>4)
- i = 0; //Keep setting the to value i and increment i, if i goes above 4, reset the LEDS
- i++;
+ wait(0.5);
+ if(i>4)
+ i = 0; //Keep setting the to value i and increment i, if i goes above 4, reset the LEDS
+ i++;
} //Loop end
} //Main end