test

Dependents:   measure_1_AAAA

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers TB6612FNG.cpp Source File

TB6612FNG.cpp

00001 #include "mbed.h"
00002 #include "TB6612FNG.h"
00003 
00004 TB6612FNG::TB6612FNG(PinName IN1, PinName IN2, PinName STBY, PinName PWM):
00005     _IN1(IN1), _IN2(IN2), _STBY(STBY), _PWM(PWM)
00006 {
00007     _PWM = 0;
00008 }
00009 
00010 void TB6612FNG::STBY(bool f)
00011 {
00012     _STBY = f;
00013 }
00014 
00015 void TB6612FNG::SetW(float W)
00016 {
00017     _PWM = W;
00018 }
00019 
00020 void TB6612FNG::Forward()
00021 {
00022     _IN1 = 1;
00023     _IN2 = 0;
00024 }
00025 
00026 void TB6612FNG::Stop()
00027 {
00028     _IN1 = 0;
00029     _IN2 = 0;
00030 }
00031 
00032 /*
00033 void TB6612FNG::Reverse(byte rpm);
00034 void TB6612FNG::Stop(byte rpm);
00035 void TB6612FNG::Brake(byte rpm);
00036 */
00037 
00038