Guillaume Chauvon
/
Asserve12
asser1
main.cpp
- Committer:
- GuillaumeCH
- Date:
- 2019-05-08
- Revision:
- 4:deef042e9c02
- Parent:
- 3:1dba6eca01ad
File content as of revision 4:deef042e9c02:
#include "mbed.h" #include "hardware.h" #include "odometrie.h" #include "reglages.h" #include "commande_moteurs.h" #include "deplacement.h" int main() { //ini init_odometrie(); init_hardware(); srand(time(NULL)); motors_on(); AnalogIn Ain(A0); if(Ain.read()<0.5){ return 0; } /*DigitalIn depart(USER_BUTTON); //Pause pour sauver le robot et l'ordi while(depart);*/ deplacement robot; robot.bouton(); Ticker asser; Timer t; t.start(); //asser.attach(callback(&robot,&deplacement::asservissement),0.01); //robot.ligne_droite_v2(210000); //robot.ligne_droite_v2(210000); robot.commande_vitesse(500,0); //robot.ligne_droite_v2(150000); //robot.test_rotation_rel(90); //robot.ligne_droite_v2(40000); //robot.poussette(); //robot.reculer_un_peu(-50000); //robot.test(); //asser.detach(); //robot.vitesse_nulle_G(0); //robot.vitesse_nulle_D(0); //wait(0.2); //motors_stop(); //robot.printftab(); //printf("x : %lf,y : %lf,angle : %lf\n",get_x_actuel(),get_y_actuel(),get_angle());*/ return 0; }