Projet APP5 comm Zumo avec mbed

Dependencies:   mbed PowerControl

Files at this revision

API Documentation at this revision

Comitter:
bouaziz
Date:
Wed Dec 08 16:34:23 2021 +0000
Parent:
0:fd4714227d8e
Child:
2:d5dd5e731d4a
Commit message:
projet polytech paris saclay APP5

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 08:46:22 2021 +0000
+++ b/main.cpp	Wed Dec 08 16:34:23 2021 +0000
@@ -1,24 +1,22 @@
-#include "mbed.h"
+#include "zumo.h"
 #include "PowerControl/PowerControl.h"
 
 DigitalOut myled(LED1);
-Serial  ser(p9,p10);
+zumo myzumo;
 
 int main() {
     char v[3];
     Peripheral_PowerDown(LPC1768_PCONP_PCENET|LPC1768_PCONP_PCSPI|LPC1768_PCONP_PCRTC|LPC1768_PCONP_PCI2C2|
                           LPC1768_PCONP_PCI2S|LPC1768_PCONP_PCQEI|LPC1768_PCONP_PCI2C1|LPC1768_PCONP_PCCAN1|LPC1768_PCONP_PCCAN2);
     //and turn off the PHY OSC
-     LPC_GPIO1->FIODIR |= 0x8000000;
-     LPC_GPIO1->FIOCLR = 0x8000000;
-     
-    ser.baud(38400);
-    while(1) {     
-        wait(0.1);
-        ser.putc('A');
-        v[0]=ser.getc();
-        printf("%c\r\n",v[0]);
-        myled = (v[0]-'A' ==1 ? 1:0);
+    LPC_GPIO1->FIODIR |= 0x8000000;
+    LPC_GPIO1->FIOCLR = 0x8000000;
+    wait(1.0);
+    while(1) {
+        myzumo.speed(140,140);     
+        wait(1.);
+        myzumo.stop();
+        wait(1.);
         
     }
 }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/zumo.lib	Wed Dec 08 16:34:23 2021 +0000
@@ -0,0 +1,1 @@
+https://os.mbed.com/teams/Projet_temp_sensors/code/zumo/#7935bbc4ebf1