runToNewPosition() blocks until it is finished. Instead, set a new target once with move() or moveTo(), then call run() in the loop (run() does not block).
Cheers,
--
You received this message because you are subscribed to the Google Groups "accelstepper" group.
To unsubscribe from this group and stop receiving emails from it, send an email to accelstepper...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Only increment/decrement a value when a specific time has passed since the last increment/decrement.
If (reading == HIGH && millis() - prev_update_time >= 200)
{
prev_update_time = millis();
//change the value
}