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
TB6612.h@3:f70ecf1e21d5, 2019-11-23 (annotated)
- Committer:
- KINU
- Date:
- Sat Nov 23 10:06:03 2019 +0000
- Revision:
- 3:f70ecf1e21d5
moterCameraUS015sb612
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| KINU | 3:f70ecf1e21d5 | 1 | /** |
| KINU | 3:f70ecf1e21d5 | 2 | * Motor Driver TB6612 Control Library |
| KINU | 3:f70ecf1e21d5 | 3 | * |
| KINU | 3:f70ecf1e21d5 | 4 | * -- TB6612 is a device of the rohm. |
| KINU | 3:f70ecf1e21d5 | 5 | * |
| KINU | 3:f70ecf1e21d5 | 6 | * Copyright (C) 2012 Junichi Katsu (JKSOFT) |
| KINU | 3:f70ecf1e21d5 | 7 | */ |
| KINU | 3:f70ecf1e21d5 | 8 | |
| KINU | 3:f70ecf1e21d5 | 9 | #ifndef MBED_TB6612_H |
| KINU | 3:f70ecf1e21d5 | 10 | #define MBED_TB6612_H |
| KINU | 3:f70ecf1e21d5 | 11 | |
| KINU | 3:f70ecf1e21d5 | 12 | #include "mbed.h" |
| KINU | 3:f70ecf1e21d5 | 13 | |
| KINU | 3:f70ecf1e21d5 | 14 | class TB6612 { |
| KINU | 3:f70ecf1e21d5 | 15 | public: |
| KINU | 3:f70ecf1e21d5 | 16 | TB6612(PinName pwm, PinName fwd, PinName rev); |
| KINU | 3:f70ecf1e21d5 | 17 | void speed(int speed); |
| KINU | 3:f70ecf1e21d5 | 18 | void move(int speed , int time); |
| KINU | 3:f70ecf1e21d5 | 19 | void operator= ( int value ) |
| KINU | 3:f70ecf1e21d5 | 20 | { |
| KINU | 3:f70ecf1e21d5 | 21 | speed(value); |
| KINU | 3:f70ecf1e21d5 | 22 | } |
| KINU | 3:f70ecf1e21d5 | 23 | |
| KINU | 3:f70ecf1e21d5 | 24 | protected: |
| KINU | 3:f70ecf1e21d5 | 25 | PwmOut _pwm; |
| KINU | 3:f70ecf1e21d5 | 26 | DigitalOut _fwd; |
| KINU | 3:f70ecf1e21d5 | 27 | DigitalOut _rev; |
| KINU | 3:f70ecf1e21d5 | 28 | }; |
| KINU | 3:f70ecf1e21d5 | 29 | |
| KINU | 3:f70ecf1e21d5 | 30 | #endif |