frequency change?
Fork of BridgeDriver by
Diff: BridgeDriver.cpp
- Revision:
- 8:36e2cd31ccf3
- Parent:
- 7:7dabd934ebe4
--- a/BridgeDriver.cpp Thu Jul 24 21:48:32 2014 +0000 +++ b/BridgeDriver.cpp Mon Jul 28 18:17:29 2014 +0000 @@ -11,7 +11,8 @@ _enAddr(enAddr), _ledAddr(ledAddr), _pwmCh(0x00), - _oldLedState(0x00) + _oldLedState(0x00), + _PWMperiod(DEFAULT_PWM_PERIOD) { @@ -383,7 +384,7 @@ _p[ch] = new PwmOut(PIN_CH8); break; } - _p[ch]->period(PWM_PERIOD); + _p[ch]->period(_PWMperiod); _pwmCh = _pwmCh | (1 << ch); } } @@ -406,4 +407,8 @@ ); lcd->setAddress(0,3); lcd->printf("dir:%+d,%+d,%+d,%+d ", _dir[0], _dir[1], _dir[2], _dir[3]); +} + +void BridgeDriver::setPWMperiod(float newPWMperiod){ + _PWMperiod = newPWMperiod; } \ No newline at end of file