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

Moter.h

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

File content as of revision 0:982bd54e15b1:

#ifndef MBED_MOTER_H
#define MBED_MOTER_H

#include "mbed.h"

class Moter
{

public:

    Moter(PinName pwm, PinName in1, PinName in2);

    float speed(float speed);

    void operator = ( float value ) {
        speed(value);
    }

protected:
    PwmOut _pwm;
    DigitalOut _in1;
    DigitalOut _in2;
};

#endif