AccelStepperI2C
v 0.1
I2C wrapper (and a bit more) for the AccelStepper Arduino library
|
Go to the documentation of this file.
25 const uint32_t
msp = 30000000;
44 Serial.println(
"\n\n\nAccelStepperI2C demo - Speed tests\n\n");
48 Serial.print(
"\n\nresetting slave\n");
49 resetAccelStepperSlave(
addr);
56 Serial.println(
"\n\nMeasuring processing times (in milliseconds)\n\n");
61 Serial.print(
S[i]->myNum + 1); Serial.println(
" steppers attached");
108 Serial.print(
"runSpeed: ");
113 Serial.print(
countCycles(ms)); Serial.print((
S[i]->getState() != 0) ?
" " :
"_");
115 Serial.print(0); Serial.print(
" ");
121 Serial.print(
"runSpeedToPosition: ");
127 Serial.print(
countCycles(ms)); Serial.print((
S[i]->getState() != 0) ?
" " :
"_");
129 Serial.print(0); Serial.print(
" ");
135 Serial.print(
"run: ");
140 Serial.print(
countCycles(ms)); Serial.print((
S[i]->getState() != 0) ?
" " :
"_");
141 Serial.print(
"["); Serial.print(
S[i]->distanceToGo()); Serial.print(
"] ");
143 Serial.print(0); Serial.print(
" ");
diagnosticsReport * report0
void moveTo(long absolute)
diagnosticsReport * report1
void diagnostics(diagnosticsReport *report)
Get most recent diagnostics data. Needs diagnostics enabled and a slave which was compiled with the D...
void stopState()
Will stop any of the above states, i.e. stop polling. It does nothing else, so the master is solely i...
void runSpeedState()
Will poll runSpeed(), i.e. run at constant speed until told otherwise (see AccelStepperI2C::stopState...
uint32_t cycles
Number of slave's main loop executions since the last reboot.
uint32_t countCycles(int millis)
diagnosticsReport * report
An I2C wrapper class for the AccelStepper library.
void setMaxSpeed(float speed)
uint16_t lastProcessTime
microseconds the slave needed to process (interpret) most recently received command
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.
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 testThem(uint32_t ms)
Used to transmit diagnostic info with AccelStepperI2C::diagnostics().
void setSpeed(float speed)
void setCurrentPosition(long position)
AccelStepperI2C * S[maxSteppers]
uint16_t lastRequestTime
microseconds the slave spent in the most recent onRequest() interrupt
void resetStepper(uint8_t stp)
uint16_t lastReceiveTime
microseconds the slave spent in the most recent onReceive() interrupt