mbed device driver for Toshiba TB6612FNG motor driver
Dependents: ROBot TB6612FNG_Sample TB6612FNG_Sample
Revision 1:8f562bdd5e93, committed 2013-12-02
- Comitter:
- rabad1
- Date:
- Mon Dec 02 03:58:48 2013 +0000
- Parent:
- 0:1a07771ff613
- Commit message:
- updated library
Changed in this revision
TB6612FNG.cpp | Show annotated file Show diff for this revision Revisions of this file |
TB6612FNG.h | Show annotated file Show diff for this revision Revisions of this file |
--- a/TB6612FNG.cpp Sun Nov 24 21:47:54 2013 +0000 +++ b/TB6612FNG.cpp Mon Dec 02 03:58:48 2013 +0000 @@ -33,6 +33,12 @@ nStby = SIGNAL_LOW; } +void TB6612FNG::setPwmA(float fPeriod, float fPulsewidth) +{ + pwmA.period(fPeriod); + pwmA = fPulsewidth; +} + void TB6612FNG::setPwmAperiod(float fPeriod) { pwmA.period(fPeriod); @@ -43,6 +49,12 @@ pwmA = fPulsewidth; } +void TB6612FNG::setPwmB(float fPeriod, float fPulsewidth) +{ + pwmB.period(fPeriod); + pwmB = fPulsewidth; +} + void TB6612FNG::setPwmBperiod(float fPeriod) { pwmB.period(fPeriod); @@ -98,3 +110,4 @@ nStby = SIGNAL_HIGH; } +
--- a/TB6612FNG.h Sun Nov 24 21:47:54 2013 +0000 +++ b/TB6612FNG.h Mon Dec 02 03:58:48 2013 +0000 @@ -67,8 +67,10 @@ TB6612FNG( PinName pinPwmA, PinName pinAin1, PinName pinAin2, PinName pinPwmB, PinName pinBin1, PinName pinBin2, PinName pinNStby ); + void setPwmA(float fPeriod, float fPulsewidth); void setPwmAperiod(float fPeriod); void setPwmApulsewidth(float fPulsewidth); + void setPwmB(float fPeriod, float fPulsewidth); void setPwmBperiod(float fPeriod); void setPwmBpulsewidth(float fPulsewidth); void standby(void);