Commandes (moteur x2)
Dependencies: BSP_DISCO_F429ZI LCD_DISCO_F429ZI mbed
commandes.cpp
- Committer:
- RpzEnsea4ever
- Date:
- 2018-05-17
- Revision:
- 3:aaaf32b91cce
- Parent:
- 2:62575002e4bb
File content as of revision 3:aaaf32b91cce:
#include "mbed.h" #include "LCD_DISCO_F429ZI.h" #include "commandes.h" AnalogOut moteur1(PA_4); //moteur droit AnalogOut moteur2(PA_5); //moteur gauche float vitesse=0.5; void arreter(){ moteur1=0; moteur2=moteur1; } void avancer(){ moteur1=vitesse*0.3+0.7;; moteur2=moteur1; } void tourner_droite(){ moteur1=0.70; moteur2=1.0; } void tourner_gauche(){ moteur1=1.0; moteur2=0.70; } void tournerDroitVite(){ moteur1=0.0; moteur2=1.0; } void tournerGaucheVite(){ moteur1=1.0; moteur2=0.0; }