Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependents: measure_1_BBB measure_1_CCC measure_1_DDD
TB6612FNG.cpp
- Committer:
- Satoshisatoshi
- Date:
- 2021-05-07
- Revision:
- 0:085abb7f6992
- Child:
- 1:4c4f2d25dc05
File content as of revision 0:085abb7f6992:
#include "mbed.h"
#include "TB6612FNG.h"
TB6612FNG::TB6612FNG(PinName IN1, PinName IN2, PinName STBY, PinName PWM):
_IN1(IN1), _IN2(IN2), _STBY(STBY), _PWM(PWM)
{
_PWM = 0;
}
void TB6612FNG::STBY(bool f)
{
_STBY = f;
}
void TB6612FNG::SetW(float W)
{
_PWM = W;
}
void TB6612FNG::Forward()
{
_IN1 = 1;
_IN2 = 0;
}
void TB6612FNG::Stop()
{
_IN1 = 0;
_IN2 = 0;
}
/*
void TB6612FNG::Reverse(byte rpm);
void TB6612FNG::Stop(byte rpm);
void TB6612FNG::Brake(byte rpm);
*/