AccelStepperI2C
v 0.1
I2C wrapper (and a bit more) for the AccelStepper Arduino library
|
Go to the documentation of this file.
33 uint8_t pin1, uint8_t pin2, uint8_t pin3, uint8_t pin4,
221 uint8_t bits = (uint8_t)directionInvert << 0 | (uint8_t)stepInvert << 1 | (uint8_t)enableInvert << 2;
230 uint8_t bits = (uint8_t)pin1Invert << 0 | (uint8_t)pin2Invert << 1 | (uint8_t)pin3Invert << 2 | (uint8_t)pin4Invert << 3 | (uint8_t)enableInvert << 4;
const uint8_t diagnosticsCmd
A helper class for the AccelStepperI2C (and ServoI2C) library.
boolean runSpeedToPosition()
Don't use this, use state machine instead with runSpeedToPositionState().
const uint8_t diagnosticsResult
void setPinsInverted(bool directionInvert=false, bool stepInvert=false, bool enableInvert=false)
void setState(uint8_t newState)
Set the state machine's state manually.
const uint8_t state_runSpeed
corresponds to AccelStepper::runSpeed(), will remain active until stopped by user or endstop
const uint8_t setMinPulseWidthCmd
void moveTo(long absolute)
const uint8_t speedResult
void setEnablePin(uint8_t enablePin=0xff)
const uint8_t currentPositionResult
void diagnostics(diagnosticsReport *report)
Get most recent diagnostics data. Needs diagnostics enabled and a slave which was compiled with the D...
const uint8_t isRunningCmd
void stopState()
Will stop any of the above states, i.e. stop polling. It does nothing else, so the master is solely i...
void prepareCommand(uint8_t cmd, uint8_t unit=-1)
void runSpeedState()
Will poll runSpeed(), i.e. run at constant speed until told otherwise (see AccelStepperI2C::stopState...
const uint8_t runSpeedCmd
const uint8_t enableDiagnosticsCmd
const uint8_t disableOutputsCmd
const uint8_t setMaxSpeedCmd
int8_t myNum
Stepper number with myNum >= 0 for successfully added steppers.
const uint8_t enableInterruptsCmd
const uint8_t targetPositionResult
const uint8_t getStateResult
uint8_t endstops()
Read current state of endstops.
const uint8_t currentPositionCmd
void read(T &value)
Read any basic data type from the buffer from the current position and increment the position pointer...
const uint8_t endstopsResult
void setMaxSpeed(float speed)
boolean run()
Don't use this, use state machine instead with runState().
const uint8_t setPinsInverted1Cmd
A helper class for the AccelStepperI2C (and ServoI2C) library.
const uint8_t runSpeedResult
const uint8_t state_run
corresponds to AccelStepper::run(), will fall back to state_stopped if target reached or endstop hit
AccelStepperI2C(I2Cwrapper *w)
Constructor.
bool readResult(uint8_t numBytes)
const uint8_t getStateCmd
void enableDiagnostics(bool enable)
Turn on/off diagnostic speed logging.
void runSpeedToPositionState()
Will poll runSpeedToPosition(), i.e. run at constant speed until target has been reached.
const uint8_t setEnablePinCmd
void runToNewPosition(long position)
This is a blocking function in the original, it will only return after the new target has been reache...
const uint8_t runSpeedToPositionResult
void runState()
Will poll run(), i.e. run to the target with acceleration and stop the state machine upon reaching it...
void setAcceleration(float acceleration)
const uint8_t setAccelerationCmd
const uint8_t setPinsInverted2Cmd
const uint8_t setCurrentPositionCmd
const uint8_t state_stopped
stepper state machine states
const uint8_t attachResult
boolean runSpeed()
Don't use this, use state machine instead with runSpeedState().
Used to transmit diagnostic info with AccelStepperI2C::diagnostics().
const uint8_t endstopsCmd
const uint8_t setEndstopPinCmd
void setSpeed(float speed)
const uint8_t distanceToGoCmd
const uint8_t maxSpeedCmd
const uint8_t state_runSpeedToPosition
corresponds to AccelStepper::state_runSpeedToPosition(), will fall back to state_stopped if target po...
const uint8_t isRunningResult
const uint8_t targetPositionCmd
void attach(uint8_t interface=AccelStepper::FULL4WIRE, uint8_t pin1=2, uint8_t pin2=3, uint8_t pin3=4, uint8_t pin4=5, bool enable=true)
Replaces the AccelStepper constructor and takes the same arguments. Will allocate an AccelStepper obj...
const uint8_t enableOutputsCmd
void setCurrentPosition(long position)
void enableInterrupts(bool enable=true)
Start or stop sending interrupts to master for this stepper. An interrupt will be sent whenever a sta...
void setEndstopPin(int8_t pin, bool activeLow, bool internalPullup)
Define a new endstop pin. Each stepper can have up to two, so don't call this more than twice per ste...
void runToPosition()
This is a blocking function in the original, it will only return after the target has been reached....
const uint8_t setSpeedCmd
uint8_t getState()
Read the state machine's state (it may have been changed by endstop or target reached condition).
const uint8_t setStateCmd
const uint8_t enableEndstopsCmd
void setMinPulseWidth(unsigned int minWidth)
void enableEndstops(bool enable=true)
Tell the state machine to check the endstops regularly. If any of the (one or two) stepper's endstops...
void write(const T &value)
Write any basic data type to the buffer at the current position and increment the position pointer ac...
const uint8_t runSpeedToPositionCmd
const uint8_t maxSpeedResult
const uint8_t distanceToGoResult