radar

Dependencies:   Servo

Revision:
2:fdb856775f71
Parent:
1:5b8b3a6e9f8c
--- a/main.cpp	Wed Nov 18 17:00:44 2020 +0000
+++ b/main.cpp	Thu Dec 03 13:19:37 2020 +0000
@@ -3,11 +3,9 @@
 #include "Servo.h"
 
 Serial pc(USBTX, USBRX);
-
 DigitalOut trig(D3);
 DigitalIn echo(D2);
 Servo myservo(D4);
-
 Thread hilo_tarea1;
 Thread hilo_tarea2;
 Timer senal;
@@ -41,7 +39,7 @@
         while(echo==1);
         senal.stop();
         distancia = (senal.read_us())/58;
-        pc.printf("%.f;%.f\n\r",angle,distancia);
+        pc.printf("' ',%f,%f,\r\n' '",angle,distancia);
         ThisThread::sleep_for(50);
     }
 }