|
upm
0.4.0
Sensor/Actuator repository for libmraa (v0.8.0)
|
UPM module for the ULN200XA Darlington Stepper Driver. More...
This module was developed on a ULN2003A Stepper Driver. It should also support the ULN2001A, ULN2002A, and ULN2004A devices, when using to drive the 28BYJ-48 unipolar stepper motor.
Example driving a stepper motor
Public Types | |
| enum | ULN200XA_DIRECTION_T { DIR_CW = 0x01, DIR_CCW = 0x02 } |
Public Member Functions | |
| ULN200XA (int stepsPerRev, int i1, int i2, int i3, int i4) | |
| ~ULN200XA () | |
| uint32_t | getMillis () |
| void | initClock () |
| void | setSpeed (int speed) |
| void | setDirection (ULN200XA_DIRECTION_T dir) |
| void | stepperSteps (unsigned int steps) |
| void | release () |
| ULN200XA | ( | int | stepsPerRev, |
| int | i1, | ||
| int | i2, | ||
| int | i3, | ||
| int | i4 | ||
| ) |
ULN200XA constructor
| stepsPerRev | Number of steps per full revolution |
| i1 | Digital pin to use for stepper input 1 |
| i2 | Digital pin to use for stepper input 2 |
| i3 | Digital pin to use for stepper input 3 |
| i4 | Digital pin to use for stepper input 4 |
| uint32_t getMillis | ( | ) |
Returns the number of milliseconds elapsed since initClock() was last called.
| void initClock | ( | ) |
Resets the clock
| void setSpeed | ( | int | speed | ) |
Sets the speed of the stepper motor in revolutions per minute (RPM)
| speed | Speed to set the motor to, in RPM |
| void setDirection | ( | ULN200XA_DIRECTION_T | dir | ) |
Sets the direction of the motor, clockwise or counterclockwise
| dir | Direction to set the motor to |
| void stepperSteps | ( | unsigned int | steps | ) |
Steps the stepper motor a specified number of steps
| steps | Number of steps to move the stepper motor |
| void release | ( | ) |
Releases the stepper motor by removing power
1.8.9.1