TI_TB6612FNG is a library of TB6612FNG.
Dependents: TI_TB6612FNG_SAMPLE
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); }
Diff: TI_TB6612FNG.h
- Revision:
- 0:982bd54e15b1
diff -r 000000000000 -r 982bd54e15b1 TI_TB6612FNG.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/TI_TB6612FNG.h Mon Jun 04 23:14:18 2018 +0000 @@ -0,0 +1,26 @@ +#ifndef MBED_TI_TB6612FNG_H +#define MBED_TI_TB6612FNG_H + +#include "mbed.h" +#include "Moter.h" + +class TI_TB6612FNG +{ +public: + TI_TB6612FNG(PinName pwma, PinName ain1, PinName ain2, PinName pwmb, PinName bin1, PinName bin2, PinName standby); + void stop(); + void forward(float speed); + void backward(float speed); + void left(float speed); + void right(float speed); + bool isForward(); + +private: + Moter _motorL; + Moter _motorR; + DigitalOut _standby; + + bool _isForward; +}; + +#endif