25 #ifndef STEPPERMOTOR_H_
26 #define STEPPERMOTOR_H_
27 #include "../gpio/GPIO.h"
45 GPIO *gpio_MS1, *gpio_MS2, *gpio_STEP, *gpio_SLP, *gpio_DIR;
46 unsigned int uSecDelay;
51 int stepsPerRevolution;
53 void init(
int speedRPM,
int stepsPerRevolution);
57 GPIO *gpio_DIR,
int speedRPM = 60,
int stepsPerRevolution = 200);
58 StepperMotor(
int gpio_MS1,
int gpio_MS2,
int gpio_STEP,
int gpio_SLP,
59 int gpio_DIR,
int speedRPM = 60,
int stepsPerRevolution = 200);
62 virtual void step(
int numberOfSteps);
65 virtual void rotate(
float degrees);
84 int threadedStepPeriod, threadedStepNumber;
Definition: StepperMotor.h:39
int(* CallbackType)(int)
Definition: GPIO.h:40
virtual void setStepsPerRevolution(int steps)
Definition: StepperMotor.h:73
virtual void setSpeed(float rpm)
Definition: StepperMotor.cpp:108
virtual STEP_MODE getStepMode()
Definition: StepperMotor.h:70
Definition: StepperMotor.h:40
GPIO class for input and output functionality on a single GPIO pin.
Definition: GPIO.h:46
virtual DIRECTION getDirection()
Definition: StepperMotor.h:67
virtual int getStepsPerRevolution()
Definition: StepperMotor.h:74
virtual void setStepMode(STEP_MODE mode)
Definition: StepperMotor.cpp:82
virtual void wake()
Definition: StepperMotor.cpp:171
virtual int threadedStepForDuration(int numberOfSteps, int duration_ms)
Definition: StepperMotor.cpp:133
DIRECTION
Definition: StepperMotor.h:40
virtual bool isAsleep()
Definition: StepperMotor.h:77
Definition: StepperMotor.h:40
A class to control a stepper motor using a motor driver board, such as the Easy Driver board...
Definition: StepperMotor.h:36
virtual void reverseDirection()
Definition: StepperMotor.cpp:151
virtual void step()
Definition: StepperMotor.cpp:127
Definition: StepperMotor.h:39
virtual void rotate(float degrees)
Definition: StepperMotor.cpp:158
Definition: StepperMotor.h:39
Definition: BusDevice.cpp:27
virtual ~StepperMotor()
Definition: StepperMotor.cpp:176
friend void * threadedStep(void *value)
Definition: StepperMotor.cpp:179
StepperMotor(GPIO *gpio_MS1, GPIO *gpio_MS2, GPIO *gpio_STEP, GPIO *gpio_SLP, GPIO *gpio_DIR, int speedRPM=60, int stepsPerRevolution=200)
Definition: StepperMotor.cpp:33
STEP_MODE
Definition: StepperMotor.h:39
virtual void threadedStepCancel()
Definition: StepperMotor.h:64
Definition: StepperMotor.h:39
virtual void setDirection(DIRECTION direction)
Definition: StepperMotor.cpp:145
virtual void sleep()
Definition: StepperMotor.cpp:166
virtual float getSpeed()
Definition: StepperMotor.h:72
void * threadedStep(void *value)
Definition: StepperMotor.cpp:179