Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
sm_servo.h@8:f23601373e8b, 2019-10-02 (annotated)
- Committer:
- GaspardD
- Date:
- Wed Oct 02 22:25:12 2019 +0000
- Revision:
- 8:f23601373e8b
- Parent:
- 6:ab9f3695633f
- Child:
- 9:1b54bac6d9a7
angle correction working
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
GaspardD | 2:e9d928fd327a | 1 | #ifndef H_SM_SERVO |
GaspardD | 2:e9d928fd327a | 2 | #define H_SM_SERVO |
GaspardD | 2:e9d928fd327a | 3 | |
GaspardD | 2:e9d928fd327a | 4 | #include "utils.h" |
GaspardD | 8:f23601373e8b | 5 | #include "odom.h" |
GaspardD | 2:e9d928fd327a | 6 | |
GaspardD | 3:1b7eb426247e | 7 | #define SERVO_PERIOD_DURATION_MS 20 //20ms is default but 10ms seems ok |
GaspardD | 8:f23601373e8b | 8 | #define SERVO_PULSE_MIDDLE_US 1500 |
GaspardD | 4:efa207509f63 | 9 | #define SERVO_PULSE_MAX_US 2000 |
GaspardD | 4:efa207509f63 | 10 | #define SERVO_PULSE_MIN_US 1050 |
GaspardD | 2:e9d928fd327a | 11 | |
GaspardD | 2:e9d928fd327a | 12 | /* |
GaspardD | 2:e9d928fd327a | 13 | Enums |
GaspardD | 2:e9d928fd327a | 14 | */ |
GaspardD | 2:e9d928fd327a | 15 | |
GaspardD | 2:e9d928fd327a | 16 | typedef enum{ |
GaspardD | 2:e9d928fd327a | 17 | SERVO_INIT, |
GaspardD | 2:e9d928fd327a | 18 | SERVO_COMMAND |
GaspardD | 2:e9d928fd327a | 19 | }E_STATE_SERVO; |
GaspardD | 2:e9d928fd327a | 20 | |
GaspardD | 2:e9d928fd327a | 21 | /* |
GaspardD | 2:e9d928fd327a | 22 | Variables |
GaspardD | 2:e9d928fd327a | 23 | */ |
GaspardD | 2:e9d928fd327a | 24 | |
GaspardD | 2:e9d928fd327a | 25 | |
GaspardD | 2:e9d928fd327a | 26 | |
GaspardD | 2:e9d928fd327a | 27 | /* |
GaspardD | 2:e9d928fd327a | 28 | Functions |
GaspardD | 2:e9d928fd327a | 29 | */ |
GaspardD | 2:e9d928fd327a | 30 | void init_sm_servo(); |
GaspardD | 2:e9d928fd327a | 31 | void update_sm_servo(); |
GaspardD | 2:e9d928fd327a | 32 | void output_sm_servo(); |
GaspardD | 2:e9d928fd327a | 33 | |
GaspardD | 8:f23601373e8b | 34 | double compute_angle_correction(double consigne); |
GaspardD | 8:f23601373e8b | 35 | double pwmFromAngle(double angleDeg); |
GaspardD | 2:e9d928fd327a | 36 | |
GaspardD | 2:e9d928fd327a | 37 | #endif |