14#include "../AtomStepMotor/Stepper.h"
38float _motorSpeedRPM_ULN2003_Stepper_setting = 0.5;
45 SerialDebug.printf(
"ULN2003_StepperClass init %s\n", config);
47 _timerDelayClass_ULN2003_StepperClass =
new TimerDelayClass(_motorSpeedRPM_ULN2003_Stepper_setting);
57 SerialDebug.println(
"ULN2003_StepperClass::stop_MotorStepper");
65 _timerDelayClass_ULN2003_StepperClass->
stopDelay();
79 SerialDebug.println(
"ULN2003_StepperClass::setup_MotorStepper");
80 SerialDebug.printf(
"PINS = %d, %d, %d, %d\n",
IN1,
IN3,
IN2,
IN4);
85 if (motorSpeedRPM == 0 || motorSpeedRPM > 30)
90 if (stepsPerRevolution == 0 || stepsPerRevolution > 4000)
91 stepsPerRevolution = 2048;
93 SerialDebug.printf(
"Motor RPM = %d, stepsPerRev = %d\n", motorSpeedRPM, stepsPerRevolution);
116 SerialDebug.println(
"ULN2003_StepperClass::start_MotorStepper");
119 SerialDebug.println(
"***** ULN2003_StepperClass::Starting ULN2003_Stepper *********");
125#pragma mark NEW_CODE_HERE
134 if (motorSpeedRPM == 0 || motorSpeedRPM > 30)
139 if (stepsPerRevolution == 0 || stepsPerRevolution > 4000)
140 stepsPerRevolution = 2048;
141 SerialDebug.printf(
"Motor RPM = %d, stepsPerRev = %d\n", motorSpeedRPM, stepsPerRevolution);
151 SerialDebug.println(
"Rotating one revolution clockwise...");
156 SerialDebug.println(
"Rotating one revolution counterclockwise...");
160 SerialDebug.println(
"**************** ULN2003_StepperClass::Ending ULN2003_Stepper *************");
163 SerialMin.printf(
"Turn Length: %d seconds \n",endTime - startTime);
176 SerialDebug.println(
"ULN2003_StepperClass::delayFinished");
void main_dispatchSyncCommand(int syncCallCommand)
the main sync command (no parameters yet)
void registerPinUse_mainModule(long pin, String pinName, String moduleName, boolean isI2C)
int getTimeStamp_mainModule()
float getPreferenceFloat_mainModule(int preferenceID)
called to set a preference (which will be an identifier and a string, which can be converted to a num...
#define PREFERENCE_STEPPER_RPM_SETTING
#define PREFERENCE_STEPPER_ANGLE_FLOAT_SETTING
boolean _isSetup_ULN2003_Stepper
NOTE: this is not right as only 1 instance is around .. so this class cannot be instantiated more tha...
#define IN1
8.14.25 grabbed our own copy..
boolean isClockwiseDirection()
returns if clockwise
void setSpeedSteps(long whatSpeed, int number_of_steps)
8.14.25 set speed and number_of_steps
void step(int number_of_steps)
void setSpeed(long whatSpeed)
boolean delayFinished()
whether the currently delay is finished, false if not running at all
void stopDelay()
stops delay
void stop_MotorStepper()
stops motor
void setup_MotorStepper()
setup the PTStepper
void start_MotorStepper()
starts the PTStepper
ULN2003_StepperClass(char *config)
constructor
void loop_MotorStepper()
loop the PTStepper (so timer can run)