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.
Dependencies: mbed
main.cpp@3:0989b6368529, 2019-11-11 (annotated)
- Committer:
 - YUPPY
 - Date:
 - Mon Nov 11 12:44:03 2019 +0000
 - Revision:
 - 3:0989b6368529
 - Parent:
 - 2:9885740002da
 
motor driver;
Who changed what in which revision?
| User | Revision | Line number | New contents of line | 
|---|---|---|---|
| okini3939 | 0:bdcbec496e71 | 1 | #include "mbed.h" | 
| KINU | 2:9885740002da | 2 | #include "TB6612.h" | 
| KINU | 2:9885740002da | 3 | |
| KINU | 2:9885740002da | 4 | DigitalOut myled(LED1); | 
| KINU | 2:9885740002da | 5 | |
| KINU | 2:9885740002da | 6 | TB6612 left(p25,p17,p16); | 
| KINU | 2:9885740002da | 7 | TB6612 right(p26,p19,p18); | 
| KINU | 2:9885740002da | 8 | int main() { | 
| KINU | 2:9885740002da | 9 | while(1) { | 
| KINU | 2:9885740002da | 10 | left = 100; //左モーター100% | 
| KINU | 2:9885740002da | 11 | right = 100;//右モーター100% | 
| YUPPY | 3:0989b6368529 | 12 | wait(3.0); | 
| YUPPY | 3:0989b6368529 | 13 | printf("直進\n\r"); | 
| YUPPY | 3:0989b6368529 | 14 | left = -50;//左-50%(back) | 
| YUPPY | 3:0989b6368529 | 15 | right = -50;//右-50% | 
| YUPPY | 3:0989b6368529 | 16 | printf("バック\n\r"); | 
| YUPPY | 3:0989b6368529 | 17 | wait(3.0); | 
| YUPPY | 3:0989b6368529 | 18 | left = 20; //左モーター10% | 
| YUPPY | 3:0989b6368529 | 19 | right = 100;//右モーター100%(右折) | 
| YUPPY | 3:0989b6368529 | 20 | printf("右折\n\r"); | 
| YUPPY | 3:0989b6368529 | 21 | wait(3.0); | 
| YUPPY | 3:0989b6368529 | 22 | left = 100; //左モーター100% | 
| YUPPY | 3:0989b6368529 | 23 | right = 20;//右モーター10%(左折) | 
| YUPPY | 3:0989b6368529 | 24 | printf("左折\n\r"); | 
| YUPPY | 3:0989b6368529 | 25 | wait(3.0); | 
| YUPPY | 3:0989b6368529 | 26 | left = 0; //左モーター100% | 
| YUPPY | 3:0989b6368529 | 27 | right = 0;//右モーター10%(左折) | 
| YUPPY | 3:0989b6368529 | 28 | printf("停止\n\r"); | 
| YUPPY | 3:0989b6368529 | 29 | wait(3.0); | 
| YUPPY | 3:0989b6368529 | 30 | printf("OK\n\r"); | 
| okini3939 | 0:bdcbec496e71 | 31 | } | 
| okini3939 | 0:bdcbec496e71 | 32 | } | 
| okini3939 | 0:bdcbec496e71 | 33 | |
| okini3939 | 0:bdcbec496e71 | 34 |