Provides an API software interface to TIMER2 to control upto four stepper motors.
Diff: inc/SimpleSteppers.h
- Revision:
- 4:7b7940df7865
- Parent:
- 3:71ab7209adb3
--- a/inc/SimpleSteppers.h Mon May 02 10:17:33 2011 +0000 +++ b/inc/SimpleSteppers.h Fri May 20 09:13:31 2011 +0000 @@ -134,6 +134,8 @@ int64_t _pulseWrapNeg; uint32_t _currentMatch; + volatile int _steps_per_second; + bool _maintainPositionData; PULSE_STATE _pulseState; @@ -253,6 +255,13 @@ */ void setSpeed(double steps_per_second = 0, uint32_t raw = 0); + /** getSpeed + * + * Get the demanded motor speed in pulses per second. Zero stops all motor pulses. + * @return int steps_per_second Number of pulses per second demanded. + */ + int getSpeed(void) { return _steps_per_second; } + /** setInterval * * Set the motor speed pulse interval. Zero stops all motor pulses.