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.
main.cpp@5:8bbe640528bc, 2019-09-29 (annotated)
- Committer:
- GaspardD
- Date:
- Sun Sep 29 17:09:48 2019 +0000
- Revision:
- 5:8bbe640528bc
- Parent:
- 4:efa207509f63
- Child:
- 6:ab9f3695633f
jumper detection
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
GaspardD | 1:8faddee0e52f | 1 | #include "sm_esc.h" |
GaspardD | 2:e9d928fd327a | 2 | #include "sm_servo.h" |
GaspardD | 4:efa207509f63 | 3 | #include "sm_sections.h" |
GaspardD | 0:38b6065539a0 | 4 | |
GaspardD | 3:1b7eb426247e | 5 | int main() |
GaspardD | 3:1b7eb426247e | 6 | { |
GaspardD | 5:8bbe640528bc | 7 | //on met le jumper sur le chassis le plus récent. Avec le jumper, chassisMode = 0. |
GaspardD | 5:8bbe640528bc | 8 | chassisMode.mode(PullUp); |
GaspardD | 5:8bbe640528bc | 9 | |
GaspardD | 4:efa207509f63 | 10 | //init timers |
GaspardD | 4:efa207509f63 | 11 | timerSinceStart.start(); |
GaspardD | 0:38b6065539a0 | 12 | |
GaspardD | 4:efa207509f63 | 13 | //init_interruptions |
GaspardD | 4:efa207509f63 | 14 | button.fall(&it_pressed); |
GaspardD | 4:efa207509f63 | 15 | odom.fall(&it_odom); |
GaspardD | 3:1b7eb426247e | 16 | |
GaspardD | 1:8faddee0e52f | 17 | //init state machines |
GaspardD | 4:efa207509f63 | 18 | pc.printf("init state machines\r\n"); |
GaspardD | 3:1b7eb426247e | 19 | |
GaspardD | 4:efa207509f63 | 20 | output_sm_esc(); |
GaspardD | 3:1b7eb426247e | 21 | init_sm_servo(); |
GaspardD | 2:e9d928fd327a | 22 | |
GaspardD | 1:8faddee0e52f | 23 | while(1) { |
GaspardD | 4:efa207509f63 | 24 | |
GaspardD | 1:8faddee0e52f | 25 | update_sm_esc(); |
GaspardD | 4:efa207509f63 | 26 | update_sm_servo(); |
GaspardD | 3:1b7eb426247e | 27 | |
GaspardD | 4:efa207509f63 | 28 | output_sm_esc(); |
GaspardD | 3:1b7eb426247e | 29 | output_sm_servo(); |
GaspardD | 0:38b6065539a0 | 30 | } |
GaspardD | 0:38b6065539a0 | 31 | } |