AccelStepperI2C
v 0.1
I2C wrapper (and a bit more) for the AccelStepper Arduino library
|
Go to the documentation of this file.
31 Serial.print(
"currentPosition()= "); Serial.print(O->
currentPosition());
32 Serial.print(
" targetPosition()= "); Serial.print(O->
targetPosition());
33 Serial.print(
" distanceToGo()= "); Serial.print(O->
distanceToGo());
34 Serial.print(
" speed()= "); Serial.print(O->
speed());
35 Serial.print(
" maxSpeed()= "); Serial.println(O->
maxSpeed());
40 Serial.print(
"Let's do some dry run tests, first.\n\n");
43 Serial.print(
"\nTesting target/position related commands:\n1. set position to 500000 (long): setCurrentPosition(500000)");
47 Serial.print(
"\n2. absolute movement (long): moveTo(500500)");
51 Serial.print(
"\n3. relative movement (long): move(-500500)");
55 Serial.print(
"\n\nTesting speed related commands:\n4. set speed limit (float): setMaxSpeed(345.34)");
59 Serial.print(
"\n5. set speed (float): setSpeed(23.43)");
74 Serial.println(
"\n\nAccelStepperI2C demo - CNC Shield V3.00\n\n");
78 Serial.println(
"\n\nresetting slave\n");
79 resetAccelStepperSlave(
addr);
98 Serial.print(
"Error: Could not add one or more steppers. Halting\n\n");
101 Serial.print(
"Steppers added with internal numbers X = ");
102 Serial.print(
X->
myNum); Serial.print(
", Y = ");
103 Serial.print(
Y->
myNum); Serial.print(
", Z = ");
104 Serial.print(
Z->
myNum); Serial.print(
".\n\n");
128 Serial.print(
"transmission error");
void setPinsInverted(bool directionInvert=false, bool stepInvert=false, bool enableInvert=false)
void moveTo(long absolute)
void setEnablePin(uint8_t enablePin=0xff)
int8_t myNum
Stepper number with myNum >= 0 for successfully added steppers.
uint8_t endstops()
Read current state of endstops.
An I2C wrapper class for the AccelStepper library.
void setMaxSpeed(float speed)
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)
void setSpeed(float speed)
void setCurrentPosition(long position)
const uint8_t endstopXpin
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 printStats(AccelStepperI2C *O)
void enableEndstops(bool enable=true)
Tell the state machine to check the endstops regularly. If two switches are used, it does not differe...