Projet APP5 comm Zumo avec mbed

Dependencies:   mbed PowerControl

Files at this revision

API Documentation at this revision

Comitter:
bouaziz
Date:
Mon Jan 10 08:59:56 2022 +0000
Parent:
1:e8c4e314d8f8
Child:
3:f12fee4182d3
Commit message:
test Polytech paris saclay;

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
zumo.lib Show annotated file Show diff for this revision Revisions of this file
--- a/main.cpp	Wed Dec 08 16:34:23 2021 +0000
+++ b/main.cpp	Mon Jan 10 08:59:56 2022 +0000
@@ -3,6 +3,8 @@
 
 DigitalOut myled(LED1);
 zumo myzumo;
+Timer t1;
+long v1,v2;
 
 int main() {
     char v[3];
@@ -12,11 +14,25 @@
     LPC_GPIO1->FIODIR |= 0x8000000;
     LPC_GPIO1->FIOCLR = 0x8000000;
     wait(1.0);
+    t1.reset();
+    t1.start();
+    t1.stop();
+    printf("INIT= %u\r\n",t1.read_us());
+    t1.reset();
+    
     while(1) {
+        t1.start();
         myzumo.speed(140,140);     
-        wait(1.);
+        t1.stop();
+        v1=t1.read_us();
+        wait(0.030);
+        t1.reset();
+        t1.start();
         myzumo.stop();
-        wait(1.);
+        t1.stop();
+        v2=t1.read_us();
+        printf("%u  %u\r\n",v1,v2);
+        wait(.025);
         
     }
 }
--- a/zumo.lib	Wed Dec 08 16:34:23 2021 +0000
+++ b/zumo.lib	Mon Jan 10 08:59:56 2022 +0000
@@ -1,1 +1,1 @@
-https://os.mbed.com/teams/Projet_temp_sensors/code/zumo/#7935bbc4ebf1
+https://os.mbed.com/teams/Projet_temp_sensors/code/zumo/#1082c5b3b418