fatboyslim / Mbed 2 deprecated buttontest

Dependencies:   FRDM-TFC mbed

Revision:
4:7584ff0426f1
Parent:
3:c7caa058fc50
Child:
5:e7e4f1967fb8
--- a/main.cpp	Wed Feb 18 19:46:08 2015 +0000
+++ b/main.cpp	Wed Feb 18 19:52:34 2015 +0000
@@ -7,6 +7,8 @@
 {
     TFC_Init();
     
+    float current_servo_position = 0;
+    
     while(1) 
     {
         
@@ -16,11 +18,31 @@
                 wait(0.2);
                 TFC_BAT_LED0_OFF; 
                 wait(0.2);
+                
+                TFC_SetServo(0, current_servo_position-.05);
+                
             }
+            
         else
             {
                 TFC_BAT_LED0_ON;
             }
+            
+        if (TFC_ReadPushButton(1) != 0 )
+            {
+                TFC_BAT_LED1_ON;
+                wait(0.2);
+                TFC_BAT_LED1_OFF; 
+                wait(0.2);
+                
+                TFC_SetServo(0, current_servo_position+.05);
+            }
+            
+        else
+            {
+                TFC_BAT_LED1_ON;
+            }
+            
     }
 }
 //hi guys
\ No newline at end of file