AF_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:98dcc458e267
Child:
1:47e5a7b22c0f

File content as of revision 0:98dcc458e267:

#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;
    int stat;
};

#endif