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_MOTER_H
tichise 0:982bd54e15b1 2 #define MBED_MOTER_H
tichise 0:982bd54e15b1 3
tichise 0:982bd54e15b1 4 #include "mbed.h"
tichise 0:982bd54e15b1 5
tichise 0:982bd54e15b1 6 class Moter
tichise 0:982bd54e15b1 7 {
tichise 0:982bd54e15b1 8
tichise 0:982bd54e15b1 9 public:
tichise 0:982bd54e15b1 10
tichise 0:982bd54e15b1 11 Moter(PinName pwm, PinName in1, PinName in2);
tichise 0:982bd54e15b1 12
tichise 0:982bd54e15b1 13 float speed(float speed);
tichise 0:982bd54e15b1 14
tichise 0:982bd54e15b1 15 void operator = ( float value ) {
tichise 0:982bd54e15b1 16 speed(value);
tichise 0:982bd54e15b1 17 }
tichise 0:982bd54e15b1 18
tichise 0:982bd54e15b1 19 protected:
tichise 0:982bd54e15b1 20 PwmOut _pwm;
tichise 0:982bd54e15b1 21 DigitalOut _in1;
tichise 0:982bd54e15b1 22 DigitalOut _in2;
tichise 0:982bd54e15b1 23 };
tichise 0:982bd54e15b1 24
tichise 0:982bd54e15b1 25 #endif