AF_TB6612FNG is a library of TB6612FNG.

Example

include the mbed library with this snippet

#include "mbed.h"
#include "AF_TB6612FNG.h"

AF_TB6612FNG tb6612fng(p21, p20, p19, p22, p18, p17, p12);

int main() {
    float speed = 0.6;
    tb6612fng.forward(speed);
}
Committer:
tichise
Date:
Mon Jun 04 00:23:18 2018 +0000
Revision:
0:98dcc458e267
Child:
2:d6cb78f523b0
new

Who changed what in which revision?

UserRevisionLine numberNew contents of line
tichise 0:98dcc458e267 1 #ifndef MBED_AF_TB6612FNG_H
tichise 0:98dcc458e267 2 #define MBED_AF_TB6612FNG_H
tichise 0:98dcc458e267 3
tichise 0:98dcc458e267 4 #include "mbed.h"
tichise 0:98dcc458e267 5 #include "Moter.h"
tichise 0:98dcc458e267 6
tichise 0:98dcc458e267 7 class AF_TB6612FNG
tichise 0:98dcc458e267 8 {
tichise 0:98dcc458e267 9 public:
tichise 0:98dcc458e267 10 AF_TB6612FNG(PinName pwma, PinName ain1, PinName ain2, PinName pwmb, PinName bin1, PinName bin2, PinName standby);
tichise 0:98dcc458e267 11 void stop();
tichise 0:98dcc458e267 12 void forward(float speed);
tichise 0:98dcc458e267 13 void back(float speed);
tichise 0:98dcc458e267 14 void left(float speed);
tichise 0:98dcc458e267 15 void right(float speed);
tichise 0:98dcc458e267 16 bool isForward();
tichise 0:98dcc458e267 17 void setISForward(bool isForward);
tichise 0:98dcc458e267 18
tichise 0:98dcc458e267 19 private:
tichise 0:98dcc458e267 20 Moter _motorL;
tichise 0:98dcc458e267 21 Moter _motorR;
tichise 0:98dcc458e267 22 DigitalOut _standby;
tichise 0:98dcc458e267 23
tichise 0:98dcc458e267 24 bool _isForward;
tichise 0:98dcc458e267 25 };
tichise 0:98dcc458e267 26
tichise 0:98dcc458e267 27 #endif