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@0:6cf9362fc1a1, 2020-08-26 (annotated)
- Committer:
- d2_h10s
- Date:
- Wed Aug 26 06:22:26 2020 +0000
- Revision:
- 0:6cf9362fc1a1
- Child:
- 1:9b7603b90063
my one;
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
d2_h10s | 0:6cf9362fc1a1 | 1 | #include "mbed.h" |
d2_h10s | 0:6cf9362fc1a1 | 2 | #include "Robot.h" |
d2_h10s | 0:6cf9362fc1a1 | 3 | |
d2_h10s | 0:6cf9362fc1a1 | 4 | #define L_dir D2 |
d2_h10s | 0:6cf9362fc1a1 | 5 | #define L_step D3 |
d2_h10s | 0:6cf9362fc1a1 | 6 | #define L_enb D4 |
d2_h10s | 0:6cf9362fc1a1 | 7 | #define R_dir D5 |
d2_h10s | 0:6cf9362fc1a1 | 8 | #define R_step D6 |
d2_h10s | 0:6cf9362fc1a1 | 9 | #define R_enb D7 |
d2_h10s | 0:6cf9362fc1a1 | 10 | |
d2_h10s | 0:6cf9362fc1a1 | 11 | Robot a(L_dir, L_step, L_enb, R_dir, R_step, R_enb); |
d2_h10s | 0:6cf9362fc1a1 | 12 | |
d2_h10s | 0:6cf9362fc1a1 | 13 | int main(){ |
d2_h10s | 0:6cf9362fc1a1 | 14 | a.enable(both); |
d2_h10s | 0:6cf9362fc1a1 | 15 | a.move_cm(go, 10); |
d2_h10s | 0:6cf9362fc1a1 | 16 | while(1){ |
d2_h10s | 0:6cf9362fc1a1 | 17 | //a.move_speed(go, 30); |
d2_h10s | 0:6cf9362fc1a1 | 18 | while(a.isRun()){ |
d2_h10s | 0:6cf9362fc1a1 | 19 | //a.run_speed(both); |
d2_h10s | 0:6cf9362fc1a1 | 20 | a.run(both); |
d2_h10s | 0:6cf9362fc1a1 | 21 | } |
d2_h10s | 0:6cf9362fc1a1 | 22 | a.stop(both); |
d2_h10s | 0:6cf9362fc1a1 | 23 | } |
d2_h10s | 0:6cf9362fc1a1 | 24 | } |
d2_h10s | 0:6cf9362fc1a1 | 25 |