This is the only class outside the stepper hierarchy, it is made to control a single stepper motor. The other classes are made to control a pair of motors in differential configuration.
Public declaration:
#define SM_BRAKE_CUT_PERCENT 65 enum TStepDirection { stpDir_Back= -1, stpDir_Stay= 0, stpDir_Ahead= 1}; class StpSingleOwner{ public: virtual void onMoveDone(byte motorID, long steps){} virtual void onStepsDone(byte motorID, long steps, long totalSteps){} }; class StepperSingle{ public: // Construction StepperControl(); StepperControl(byte motorID, StpSingleOwner* owner); // Initialization void begin(uint startSpeed, uint cruiseSpeed); void beginPins(int mPin1, int mPin2, int mPin3, int mPin4); void setBrakeCutPercent(byte brakeCutPercent); void turboOn(); void turboOff(); void halfStepOn(); void halfStepOff(); void setReportSteps(long steps); void enableAutoRun(); // Operation void run(); void moveSteps(TStepDirection direction, long steps, boolean oddOnly= false); void moveOn(TStepDirection direction, boolean oddOnly= false); void stopNow(); void decelStop(); void motorOff(); // Monitoring boolean halfStep(); boolean isMoving(); };
Wiki: StepperCouple
Wiki: StepperDuo
Wiki: StepperMotors
Wiki: StpDuoBuff
Wiki: StpDuoTimer2