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.
utils.cpp@4:efa207509f63, 2019-09-29 (annotated)
- Committer:
- GaspardD
- Date:
- Sun Sep 29 14:58:03 2019 +0000
- Revision:
- 4:efa207509f63
- Parent:
- 3:1b7eb426247e
- Child:
- 5:8bbe640528bc
algo fonctionnel direction + esc rotation a droite 10 sec a vitesse minimale
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
GaspardD | 1:8faddee0e52f | 1 | #include "utils.h" |
GaspardD | 1:8faddee0e52f | 2 | |
GaspardD | 1:8faddee0e52f | 3 | bool b_UTILS_flag_button = false; |
GaspardD | 1:8faddee0e52f | 4 | bool b_UTILS_flag_emergency_stop = false; |
GaspardD | 4:efa207509f63 | 5 | Timer timerSinceStart; |
GaspardD | 4:efa207509f63 | 6 | |
GaspardD | 1:8faddee0e52f | 7 | Serial pc(USBTX, USBRX); |
GaspardD | 1:8faddee0e52f | 8 | InterruptIn button(USER_BUTTON); |
GaspardD | 1:8faddee0e52f | 9 | |
GaspardD | 1:8faddee0e52f | 10 | |
GaspardD | 4:efa207509f63 | 11 | void it_pressed() |
GaspardD | 4:efa207509f63 | 12 | { |
GaspardD | 4:efa207509f63 | 13 | if(timerSinceStart.read_ms() > 500) { |
GaspardD | 4:efa207509f63 | 14 | timerSinceStart.reset(); |
GaspardD | 4:efa207509f63 | 15 | pc.printf("Button pressed\r\n"); |
GaspardD | 4:efa207509f63 | 16 | b_UTILS_flag_button = true; |
GaspardD | 4:efa207509f63 | 17 | b_UTILS_flag_emergency_stop = false; |
GaspardD | 4:efa207509f63 | 18 | } |
GaspardD | 4:efa207509f63 | 19 | return; |
GaspardD | 1:8faddee0e52f | 20 | } |