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.
Dependents: measure_1_BBB measure_1_CCC measure_1_DDD
TB6612FNG.cpp@0:085abb7f6992, 2021-05-07 (annotated)
- Committer:
- Satoshisatoshi
- Date:
- Fri May 07 03:27:26 2021 +0000
- Revision:
- 0:085abb7f6992
- Child:
- 1:4c4f2d25dc05
AAAAAAAA
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| Satoshisatoshi | 0:085abb7f6992 | 1 | #include "mbed.h" |
| Satoshisatoshi | 0:085abb7f6992 | 2 | #include "TB6612FNG.h" |
| Satoshisatoshi | 0:085abb7f6992 | 3 | |
| Satoshisatoshi | 0:085abb7f6992 | 4 | TB6612FNG::TB6612FNG(PinName IN1, PinName IN2, PinName STBY, PinName PWM): |
| Satoshisatoshi | 0:085abb7f6992 | 5 | _IN1(IN1), _IN2(IN2), _STBY(STBY), _PWM(PWM) |
| Satoshisatoshi | 0:085abb7f6992 | 6 | { |
| Satoshisatoshi | 0:085abb7f6992 | 7 | _PWM = 0; |
| Satoshisatoshi | 0:085abb7f6992 | 8 | } |
| Satoshisatoshi | 0:085abb7f6992 | 9 | |
| Satoshisatoshi | 0:085abb7f6992 | 10 | void TB6612FNG::STBY(bool f) |
| Satoshisatoshi | 0:085abb7f6992 | 11 | { |
| Satoshisatoshi | 0:085abb7f6992 | 12 | _STBY = f; |
| Satoshisatoshi | 0:085abb7f6992 | 13 | } |
| Satoshisatoshi | 0:085abb7f6992 | 14 | |
| Satoshisatoshi | 0:085abb7f6992 | 15 | void TB6612FNG::SetW(float W) |
| Satoshisatoshi | 0:085abb7f6992 | 16 | { |
| Satoshisatoshi | 0:085abb7f6992 | 17 | _PWM = W; |
| Satoshisatoshi | 0:085abb7f6992 | 18 | } |
| Satoshisatoshi | 0:085abb7f6992 | 19 | |
| Satoshisatoshi | 0:085abb7f6992 | 20 | void TB6612FNG::Forward() |
| Satoshisatoshi | 0:085abb7f6992 | 21 | { |
| Satoshisatoshi | 0:085abb7f6992 | 22 | _IN1 = 1; |
| Satoshisatoshi | 0:085abb7f6992 | 23 | _IN2 = 0; |
| Satoshisatoshi | 0:085abb7f6992 | 24 | } |
| Satoshisatoshi | 0:085abb7f6992 | 25 | |
| Satoshisatoshi | 0:085abb7f6992 | 26 | void TB6612FNG::Stop() |
| Satoshisatoshi | 0:085abb7f6992 | 27 | { |
| Satoshisatoshi | 0:085abb7f6992 | 28 | _IN1 = 0; |
| Satoshisatoshi | 0:085abb7f6992 | 29 | _IN2 = 0; |
| Satoshisatoshi | 0:085abb7f6992 | 30 | } |
| Satoshisatoshi | 0:085abb7f6992 | 31 | |
| Satoshisatoshi | 0:085abb7f6992 | 32 | /* |
| Satoshisatoshi | 0:085abb7f6992 | 33 | void TB6612FNG::Reverse(byte rpm); |
| Satoshisatoshi | 0:085abb7f6992 | 34 | void TB6612FNG::Stop(byte rpm); |
| Satoshisatoshi | 0:085abb7f6992 | 35 | void TB6612FNG::Brake(byte rpm); |
| Satoshisatoshi | 0:085abb7f6992 | 36 | */ |
| Satoshisatoshi | 0:085abb7f6992 | 37 | |
| Satoshisatoshi | 0:085abb7f6992 | 38 |