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.
Fork of Robot2016_2-0 by
Diff: Functions/func.cpp
- Revision:
- 48:03da1aead032
- Parent:
- 46:5658af4e5149
- Child:
- 51:1056dd73a748
diff -r 5658af4e5149 -r 03da1aead032 Functions/func.cpp
--- 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
