Running stepper motor but needing to insert delays for the HIGH/LOW calls #195
Replies: 2 comments
-
Forgot to add where the code is { } void Motor(TSTRING value)
} |
Beta Was this translation helpful? Give feedback.
-
As much as possible DO NOT:
For #1 - you are already inside a loop with the scheduler, so make just one pass and return. You can use a getRunCounter() For #2 - if you need microsecond precision do one (pin HIGH - microsecond delay - pin LOW) cycle and return. Or use multicore esp32 under FreeRTOS - one task runs TS and another controls stepper. |
Beta Was this translation helpful? Give feedback.
-
Anybody used painlessmesh with a stepper motor. I have a Christmas display that I'm needing to use stepper motors to spin for say 1000 steps, then stop until it gets a command to reverse the 1000 steps.
digitalWrite(dir,HIGH);
How can I do this with painlessmesh without causing a backlog. Need I guess to have some type of non-blocking code so the other Nodes are not backed up.
Beta Was this translation helpful? Give feedback.
All reactions