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);
}

TI_TB6612FNG.h

Committer:
tichise
Date:
2018-06-04
Revision:
0:982bd54e15b1

File content as of revision 0:982bd54e15b1:

#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