Dependencies:   mbed

Files at this revision

API Documentation at this revision

Comitter:
3521456
Date:
Tue Oct 15 12:15:58 2019 +0000
Commit message:
Recepteur_SE

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
mbed.bld Show annotated file Show diff for this revision Revisions of this file
diff -r 000000000000 -r a839a51c5cec main.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Tue Oct 15 12:15:58 2019 +0000
@@ -0,0 +1,31 @@
+#include "mbed.h"
+
+Serial ant(D1, D0); //tx, rx
+Serial pc(D5,D4);
+char temp[8];
+int b_ok = 0;
+int main() {
+    pc.printf("AT$SF=%04x%04x\r\n",200,120);
+    while(1) {
+       // for(int i =0; i < 100; i++){
+            if(ant.readable())
+            {
+                ant.gets(temp,4);
+                for(int i =0; i < 4;i++){
+                    if(temp[i]=='b')
+                        b_ok=1;
+                }
+                if(b_ok==0){
+                   //pc.printf("AT$SF=%02x%02x\r\n",20,12);
+                   //wait(2);
+                   temp[0]='n';
+                   break;
+                }
+            }
+        //}
+        pc.printf("com : %c",temp[0]);
+        wait(0.5);
+        b_ok = 0;
+        //pc.printf(temp);
+    }
+}
diff -r 000000000000 -r a839a51c5cec mbed.bld
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Tue Oct 15 12:15:58 2019 +0000
@@ -0,0 +1,1 @@
+https://os.mbed.com/users/mbed_official/code/mbed/builds/65be27845400
\ No newline at end of file