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@4:8b83bf379766, 2019-12-13 (annotated)
- Committer:
- smallstone
- Date:
- Fri Dec 13 07:01:49 2019 +0000
- Revision:
- 4:8b83bf379766
- Parent:
- 3:f99d3703a6d9
kansat shuusei
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
smallstone | 0:1b294da0842e | 1 | #include "mbed.h" |
smallstone | 1:293b11fbc576 | 2 | #include "TB6612.h" |
smallstone | 0:1b294da0842e | 3 | |
smallstone | 1:293b11fbc576 | 4 | TB6612 motor1(p24,p29,p30); //pwma,AIN1,AIN2,can brake// |
smallstone | 1:293b11fbc576 | 5 | TB6612 motor2(p23,p28,p27); //pwmb,BIN1,BIN2,can brake// |
smallstone | 0:1b294da0842e | 6 | |
smallstone | 0:1b294da0842e | 7 | int main() { |
smallstone | 4:8b83bf379766 | 8 | motor1=0; //初期はスピード0 |
smallstone | 2:ea39c24e77b2 | 9 | motor2=0; |
smallstone | 3:f99d3703a6d9 | 10 | wait(20); |
smallstone | 4:8b83bf379766 | 11 | motor1=20; //スピード20% |
smallstone | 4:8b83bf379766 | 12 | motor2=20; |
smallstone | 4:8b83bf379766 | 13 | wait(20); |
smallstone | 4:8b83bf379766 | 14 | motor1=0; //スピードをリセットし、次の準備時間 |
smallstone | 2:ea39c24e77b2 | 15 | motor2=0; |
smallstone | 3:f99d3703a6d9 | 16 | wait(20); |
smallstone | 4:8b83bf379766 | 17 | motor1=40; //スピード40% |
smallstone | 4:8b83bf379766 | 18 | motor2=40; |
smallstone | 4:8b83bf379766 | 19 | wait(20); |
smallstone | 4:8b83bf379766 | 20 | motor1=0; //スピードをリセットし、次の準備時間 |
smallstone | 2:ea39c24e77b2 | 21 | motor2=0; |
smallstone | 3:f99d3703a6d9 | 22 | wait(20); |
smallstone | 4:8b83bf379766 | 23 | motor1=60; //スピード60% |
smallstone | 4:8b83bf379766 | 24 | motor2=60; |
smallstone | 4:8b83bf379766 | 25 | wait(20); |
smallstone | 4:8b83bf379766 | 26 | motor1=0; //スピードをリセットし、次の準備時間 |
smallstone | 2:ea39c24e77b2 | 27 | motor2=0; |
smallstone | 3:f99d3703a6d9 | 28 | wait(20); |
smallstone | 4:8b83bf379766 | 29 | motor1=80; //スピード80% |
smallstone | 4:8b83bf379766 | 30 | motor2=80; |
smallstone | 4:8b83bf379766 | 31 | wait(20); |
smallstone | 4:8b83bf379766 | 32 | motor1=0; //スピードをリセットし、次の準備時間 |
smallstone | 1:293b11fbc576 | 33 | motor2=0; |
smallstone | 3:f99d3703a6d9 | 34 | wait(20); |
smallstone | 4:8b83bf379766 | 35 | motor1=100; //スピード100% |
smallstone | 4:8b83bf379766 | 36 | motor2=100; |
smallstone | 4:8b83bf379766 | 37 | wait(20); |
smallstone | 4:8b83bf379766 | 38 | motor1=0; //スピードをリセットし、次の準備時間 |
smallstone | 4:8b83bf379766 | 39 | motor2=0; |
smallstone | 0:1b294da0842e | 40 | } |