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@2:e9d928fd327a, 2019-09-28 (annotated)
- Committer:
- GaspardD
- Date:
- Sat Sep 28 22:58:02 2019 +0000
- Revision:
- 2:e9d928fd327a
- Child:
- 3:1b7eb426247e
servo state machine
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 | 2:e9d928fd327a | 5 | |
GaspardD | 2:e9d928fd327a | 6 | #define SERVO_PERIOD_DURATION_MS 10 //20ms is default but 10ms seems ok |
GaspardD | 2:e9d928fd327a | 7 | #define SERVO_PULSE_MIDDLE_US 1500 |
GaspardD | 2:e9d928fd327a | 8 | #define SERVO_PULSE_MAX_US 2100 |
GaspardD | 2:e9d928fd327a | 9 | #define SERVO_PULSE_MIN_US 800 |
GaspardD | 2:e9d928fd327a | 10 | |
GaspardD | 2:e9d928fd327a | 11 | /* |
GaspardD | 2:e9d928fd327a | 12 | Enums |
GaspardD | 2:e9d928fd327a | 13 | */ |
GaspardD | 2:e9d928fd327a | 14 | |
GaspardD | 2:e9d928fd327a | 15 | typedef enum{ |
GaspardD | 2:e9d928fd327a | 16 | SERVO_INIT, |
GaspardD | 2:e9d928fd327a | 17 | SERVO_COMMAND |
GaspardD | 2:e9d928fd327a | 18 | }E_STATE_SERVO; |
GaspardD | 2:e9d928fd327a | 19 | |
GaspardD | 2:e9d928fd327a | 20 | /* |
GaspardD | 2:e9d928fd327a | 21 | Variables |
GaspardD | 2:e9d928fd327a | 22 | */ |
GaspardD | 2:e9d928fd327a | 23 | |
GaspardD | 2:e9d928fd327a | 24 | |
GaspardD | 2:e9d928fd327a | 25 | |
GaspardD | 2:e9d928fd327a | 26 | /* |
GaspardD | 2:e9d928fd327a | 27 | Functions |
GaspardD | 2:e9d928fd327a | 28 | */ |
GaspardD | 2:e9d928fd327a | 29 | void init_sm_servo(); |
GaspardD | 2:e9d928fd327a | 30 | void update_sm_servo(); |
GaspardD | 2:e9d928fd327a | 31 | void output_sm_servo(); |
GaspardD | 2:e9d928fd327a | 32 | |
GaspardD | 2:e9d928fd327a | 33 | |
GaspardD | 2:e9d928fd327a | 34 | #endif |