coucou

Dependencies:   RoboClaw mbed

Fork of Robot2016_2-0 by ARES

Revision:
48:03da1aead032
Parent:
47:5658af4e5149
Child:
52:1056dd73a748
--- a/Functions/func.cpp	Mon Apr 25 12:38:58 2016 +0000
+++ b/Functions/func.cpp	Thu Apr 28 08:11:25 2016 +0000
@@ -115,7 +115,7 @@
     else rouge = 0;
 }
 
-void init_ax12(void)
+/*void init_ax12(void)
 {
     left_hand.setMode(0);
     wait_ms(10);
@@ -131,14 +131,12 @@
     right_hand.setGoal(180);
     left_hand.setGoal(180);
     wait(2);
-}
+}*/
 
 void init_interrupt(void)
 {
     CAMP.fall(&changeCamp);
-    CAMP.rise(&changeCampoff);
-    START.rise(&letsgo);
-    START.fall(&letsgooff);
+    START.rise(&go);
     mybutton.fall(&pressed);
     mybutton.rise(&unpressed);
     EndL.fall(&ELpressed);
@@ -147,24 +145,24 @@
     EndZ.rise(&EZunpressed);
     EndR.fall(&ERpressed);
     EndR.rise(&ERunpressed);
+    ticker.attach_us(&update_main, dt); // 100 Hz
 }
 
 void changeCamp(void)
 {
-    LEDV = 1;
-}
-
-void changeCampoff(void)
-{
-    LEDV = 0;
+    if(SCouleur==VERT) {
+        SCouleur = VIOLET;
+        LEDR = 1;
+        LEDV = 0;
+    }
+    else {
+        SCouleur = VERT;
+        LEDV = 1;
+        LEDR = 0;        
+    }
 }
 
-void letsgo(void)
+void go(void)
 {
-    LEDR = 0;
-}
-
-void letsgooff(void)
-{
-    LEDR = 1;
+    SStart = 1;
 }
\ No newline at end of file