![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
...
Diff: fct.h
- Revision:
- 2:82b72fa8dbcd
- Child:
- 3:b91371837109
diff -r 714fd6b732be -r 82b72fa8dbcd fct.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/fct.h Sun May 28 17:36:57 2017 +0000 @@ -0,0 +1,53 @@ +#ifndef FCT_H +#define FCT_H +//GLOBALES +extern BusOut leds; +extern DigitalOut trigger1; +extern DigitalOut trigger2; +extern DigitalOut trigger3; +extern InterruptIn echo; +extern AnalogIn AnaG; +extern AnalogIn AnaAV; +extern PwmOut MG; //vitesse moteur gauche +extern PwmOut MD; //vitesse moteur droit +extern DigitalOut sensMG; // sens moteur gauche +extern DigitalOut sensMD; // sens moteur droit +extern Timer temp,t; +extern Ticker tic1,tic2; + +extern int drap,flag1,flag2,flag3,flag4,flag5; +extern float US1,US2,US3,AN1,AN2,US1_av,US2_av,US3_av,AN1_av,AN2_av; +extern float E_av,E,iE; +extern float cmdG,cmdD; +extern int etat; +extern float iecart,ecart_av,ecart; + + +//CONSTANTES +#define PERIOD 0.0001 +#define VMOY 30 +#define VMAX 60 +#define Kp_E 0.42 +#define Kp_ecart 0.8 +#define Td_ecart 0.0 +#define Ti_ecart 1000.0 +#define limitmin 3 +#define limitmax 150 +#define Te 0.001 +#define Ti 2.0 +#define a 24.0 +#define b 0.1 +//PROTOTYPES +void stopMotor(); +void suivi_mur(); +void rotation_horaire(); +void init(); +void asservissement(); +void fcttrig(); +float vitesse(float); +void start(); +void stop(); +float vitesse(float); +void mesAN(); + +#endif