Lights the barrery LED one-by-one, in an interval of 0.5 seconds. When button A is pressed, the LEDS hold.

Dependencies:   FRDM-TFC mbed

Revision:
3:d57fdbf06ac8
Parent:
2:61a8e97a0875
Child:
4:7bb8fce3cdd6
--- 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