test publish

Dependencies:   mbed mbed-rtos m3pi

Files at this revision

API Documentation at this revision

Comitter:
bjacque
Date:
Fri Nov 23 10:21:15 2018 +0000
Commit message:
test commit pololu

Changed in this revision

m3pi.lib Show annotated file Show diff for this revision Revisions of this file
main.cpp Show annotated file Show diff for this revision Revisions of this file
mbed-rtos.lib 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
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/m3pi.lib	Fri Nov 23 10:21:15 2018 +0000
@@ -0,0 +1,1 @@
+https://os.mbed.com/users/chris/code/m3pi/#4b7d6ea9b35b
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Fri Nov 23 10:21:15 2018 +0000
@@ -0,0 +1,84 @@
+#include "mbed.h"
+#include "m3pi.h"
+#include "rtos.h"
+//#include "MSCFileSystem.h"
+
+//DigitalOut myled(LED1);
+m3pi m3pi;
+
+//Serial pc(USBTX,USBRX);//pin pour utiliser le cable usb
+Serial pc(p28,p27);//pin pour passer par X-bee
+//DigitalOut resetxbee(p9,p10);
+//MSCFileSystem fs("fs");
+
+DigitalOut led1(LED1);
+DigitalOut led2(LED2);
+
+int main() {
+    float speed=0.2;
+    /*m3pi.leds(0);
+    m3pi.locate(0,1);*/
+    m3pi.printf("Suivi simple");
+    wait(2.0);
+    //m3pi.sensor_auto_calibrate();//calibre les capteurs
+    while(1) {
+        if(pc.readable()){
+            // Lecture capteurs
+            //m3pi.line_position();//pour lire les capteurs (renvoie un char)
+            // A COMPLETER
+            char car=pc.getc();//passe la commande
+            switch(car)
+            {
+                case 'f' ://avancer 
+                        m3pi.forward(speed);
+                        m3pi.print("Com=f",5);
+                        break;
+                case 'b' ://reculer 
+                        m3pi.backward(speed);
+                        m3pi.print("Com=b",5);
+                        break;
+                case 'l' ://tourner à gauche
+                        m3pi.left(speed);
+                        m3pi.print("Com=l",5);
+                        break;
+                case 'r' ://tourner à droite
+                        m3pi.right(speed);
+                        m3pi.print("Com=r",5);
+                        break;
+                case 's' ://stopper le robot 
+                        m3pi.stop();
+                        m3pi.print("Com=s",5);
+                        break;
+                case 'u' ://accelérer
+                        if(speed<1.0f){speed+=0.2;};
+                        break;
+                case 'd' ://ralentir 
+                        if(speed>0.0f){speed-=0.2;};
+                        break;
+                default : break;   
+            }
+        }
+    }
+}
+
+/*#include "mbed.h"
+#include "m3pi.h"
+#include "rtos.h"
+DigitalOut led1(LED1);
+DigitalOut led2(LED2);
+m3pi m3pi;
+Serial pc (USBTX,USBRX);
+int main() 
+{
+unsigned char vecteur;
+m3pi.leds(0);
+m3pi.locate(0,1);
+m3pi.printf("Suivi simple");
+wait(2.0);
+m3pi.sensor_auto_calibrate();
+while (1) {
+// Lecture capteurs
+m3pi.calibrated_sensors(capteurs);
+  // A COMPLETER
+}
+}*/
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed-rtos.lib	Fri Nov 23 10:21:15 2018 +0000
@@ -0,0 +1,1 @@
+https://os.mbed.com/teams/ST/code/mbed-rtos/#83895f30f8f2
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Fri Nov 23 10:21:15 2018 +0000
@@ -0,0 +1,1 @@
+https://os.mbed.com/users/mbed_official/code/mbed/builds/e95d10626187
\ No newline at end of file