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.
Dependencies: mbed
Diff: main.cpp
- Revision:
- 5:0f73a04481fd
- Parent:
- 4:3bff5791d6d3
- Child:
- 6:1ef44538e16d
diff -r 3bff5791d6d3 -r 0f73a04481fd main.cpp
--- a/main.cpp Fri May 24 16:55:41 2019 +0000
+++ b/main.cpp Fri May 24 17:57:01 2019 +0000
@@ -1,10 +1,10 @@
#include "mbed.h"
-Serial pc(USBTX, USBRX,115200);
-Serial BT(PA_9,PA_10,115200);
+//Serial pc(USBTX, USBRX,115200);
+Serial BT(PA_9,PA_10,115200); // Depart Bluetooth
-DigitalIn depart(A1);
+//DigitalIn depart(A1); //Depart filaire
DigitalIn interrupteur(D7);
DigitalOut led(LED1);
@@ -23,16 +23,20 @@
switch (cas) {
case 0: { //Électron immobile
- pc.printf("case 0\n\r");
+ // pc.printf("case 0\n\r");
+ // Depart Bluetooth
if(BT.readable()) { //Réception d'instruction de l'expérience
- if(BT.getc() == 'L') cas = 1; // passage à l'état 1
+ if(BT.getc() == 'D') cas = 1; // passage à l'état 1
}
+ // Depart Filaire
+ /*if(depart!=0) cas = 1;// passage à l'état 1
+ */
break;
}
case 1: { //Électron en mouvement
- pc.printf("cas 2 LANCEMENT\r");
+ //pc.printf("cas 2 LANCEMENT\r");
led = 1;
sens = 1;
moteur.pulsewidth_ms(10);
@@ -44,7 +48,7 @@
}
case 2: { //Arrêt de l'électron
- pc.printf("case 2\n\r");
+ //pc.printf("case 2\n\r");
led = 0;
moteur.pulsewidth_ms(0);
break;