![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
ultra
main.cpp
- Committer:
- qj604184
- Date:
- 2017-06-09
- Revision:
- 0:b3230a65c9b1
File content as of revision 0:b3230a65c9b1:
#include "mbed.h" #include "fct.h" #include "Pixy.h" #include "PixyLink.h" #include "SRF05.h" #define V_max 25 #define V_recherche 25 #define K 0.1 DigitalOut cs(p13); DigitalIn bp(p14); Serial pc (USBTX,USBRX); SRF05 us_arr(p8,p24); int main() { MotG.period(PERIOD); MotD.period(PERIOD); float us_arriere; Vitmoteur(0.0,0.0); while(1) { //printf("Us_arriere : %.1f\n\r", us_arr.read()); us_arriere=us_arr.read(); if(us_arriere>20) { Vitmoteur(-30,-30); } else{ Vitmoteur(0,0); } } }