Freescale_Cachan
/
Programme_course_2
programme course avec menu amélioré
Fork of Programme_course by
motor.h@0:3ec7fc598e48, 2017-01-26 (annotated)
- Committer:
- Freescale_cup
- Date:
- Thu Jan 26 07:37:45 2017 +0000
- Revision:
- 0:3ec7fc598e48
Programme de base
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
Freescale_cup | 0:3ec7fc598e48 | 1 | #ifndef MOTOR_H |
Freescale_cup | 0:3ec7fc598e48 | 2 | #define MOTOR_H |
Freescale_cup | 0:3ec7fc598e48 | 3 | #include "MKL25Z4.h" |
Freescale_cup | 0:3ec7fc598e48 | 4 | #include "mbed.h" |
Freescale_cup | 0:3ec7fc598e48 | 5 | |
Freescale_cup | 0:3ec7fc598e48 | 6 | |
Freescale_cup | 0:3ec7fc598e48 | 7 | #define MOTEUR_A 1 |
Freescale_cup | 0:3ec7fc598e48 | 8 | #define MOTEUR_B 2 |
Freescale_cup | 0:3ec7fc598e48 | 9 | |
Freescale_cup | 0:3ec7fc598e48 | 10 | #define AVANCER 1 |
Freescale_cup | 0:3ec7fc598e48 | 11 | #define RECULER 2 |
Freescale_cup | 0:3ec7fc598e48 | 12 | #define ATTENTE 3 |
Freescale_cup | 0:3ec7fc598e48 | 13 | |
Freescale_cup | 0:3ec7fc598e48 | 14 | #define PWM_ANGLE_MILIEU 0 //0.0725-0.0725 |
Freescale_cup | 0:3ec7fc598e48 | 15 | #define PWM_ANGLE_DROIT_MAX 0.02 //0.0925-0.0725 |
Freescale_cup | 0:3ec7fc598e48 | 16 | #define PWM_ANGLE_GAUCHE_MAX 0.02 //0.0525-0.0725 |
Freescale_cup | 0:3ec7fc598e48 | 17 | |
Freescale_cup | 0:3ec7fc598e48 | 18 | #define ANGLE_DROIT_MAX 30 |
Freescale_cup | 0:3ec7fc598e48 | 19 | #define ANGLE_GAUCHE_MAX 30 |
Freescale_cup | 0:3ec7fc598e48 | 20 | #define FREQ_PWM 5000 |
Freescale_cup | 0:3ec7fc598e48 | 21 | |
Freescale_cup | 0:3ec7fc598e48 | 22 | #define CORRECTION 1 |
Freescale_cup | 0:3ec7fc598e48 | 23 | |
Freescale_cup | 0:3ec7fc598e48 | 24 | #define AVANCE 4 |
Freescale_cup | 0:3ec7fc598e48 | 25 | |
Freescale_cup | 0:3ec7fc598e48 | 26 | |
Freescale_cup | 0:3ec7fc598e48 | 27 | void PWM_motor (int moteur ,int vitesse); |
Freescale_cup | 0:3ec7fc598e48 | 28 | void angle_servo_moteur (double angle); |
Freescale_cup | 0:3ec7fc598e48 | 29 | void motor_init(); |
Freescale_cup | 0:3ec7fc598e48 | 30 | |
Freescale_cup | 0:3ec7fc598e48 | 31 | extern DigitalOut activate_motor; |
Freescale_cup | 0:3ec7fc598e48 | 32 | |
Freescale_cup | 0:3ec7fc598e48 | 33 | extern PwmOut moteurA_avancer; |
Freescale_cup | 0:3ec7fc598e48 | 34 | extern PwmOut moteurA_reculer; |
Freescale_cup | 0:3ec7fc598e48 | 35 | extern PwmOut moteurB_avancer; |
Freescale_cup | 0:3ec7fc598e48 | 36 | extern PwmOut moteurB_reculer; |
Freescale_cup | 0:3ec7fc598e48 | 37 | extern PwmOut servo; |
Freescale_cup | 0:3ec7fc598e48 | 38 | #endif //MOTOR_H |