test publish
Dependencies: mbed mbed-rtos m3pi
Revision 0:2c7bdd6f45e5, committed 2018-11-23
- Comitter:
- bjacque
- Date:
- Fri Nov 23 10:21:15 2018 +0000
- Commit message:
- test commit pololu
Changed in this revision
diff -r 000000000000 -r 2c7bdd6f45e5 m3pi.lib --- /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
diff -r 000000000000 -r 2c7bdd6f45e5 main.cpp --- /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 +} +}*/
diff -r 000000000000 -r 2c7bdd6f45e5 mbed-rtos.lib --- /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
diff -r 000000000000 -r 2c7bdd6f45e5 mbed.bld --- /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