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:
- 1:7f2e4c9c6a40
- Parent:
- 0:3bfd0ae5b584
- Child:
- 2:c46e5c0f09dc
--- a/main.cpp Fri May 24 10:05:01 2019 +0000
+++ b/main.cpp Fri May 24 11:21:03 2019 +0000
@@ -1,6 +1,8 @@
#include "mbed.h"
Serial pc(USBTX, USBRX,115200);
+Serial BT(PA_9,PA_10,115200);
+
DigitalIn depart(A1);
DigitalIn interrupteur(D7);
@@ -13,7 +15,11 @@
int main()
{
+ wait(1);
DigitalOut myled(LED1);
+ BT.printf("$$$");
+ wait(1);
+ BT.printf("C\r");
while(1) {
@@ -21,15 +27,17 @@
case 0: {
pc.printf("case 0\n\r");
- if (depart != 0) {
- cas = 1;
+ if(BT.readable()){
+ if(BT.getc() == 'L') cas = 1;
}
break;
}
case 1: {
- pc.printf("case 1\n\r");
+
+
+ pc.printf("cas 2 LANCEMENT\r");
led = 1;
sens = 1;
moteur.pulsewidth_ms(10);
@@ -40,7 +48,7 @@
}
case 2: {
- pc.printf("case 1\n\r");
+ pc.printf("case 2\n\r");
led = 0;
moteur.pulsewidth_ms(0);
break;