TI_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 23:14:18 2018 +0000
Revision:
0:982bd54e15b1
new

Who changed what in which revision?

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