pkerspe / ESP-StepperMotor-Server

Turn your ESP32 into a complete stepper motor control server with web UI, REST API and serial control interface
MIT License
225 stars 39 forks source link

Stepper control and relays #35

Open une18 opened 1 year ago

une18 commented 1 year ago

I am looking for a solution to control stepper and relays. Are relays supported?

Would like to build a small device, that works in loop. Stepper turns 60 degrees, when stopped a relay will turn on solenoid valve for the set time and when completed, starts again.

A simple task in Arduino, but i remember testing Stepper motor server few years ago, and I liked it.

Could this be an option for future developement?

pkerspe commented 1 year ago

So if it is fine for you to do that in code, you could register a callback function in the flexystepper instance when the position is reached which then toggles the pin the Relay is connected to.

See the example Arduino script in line 65 where the callback handler is registered when the final position is reached:

examples/Example2_StepperMotorServer_with_hardcoded_config/Example2_StepperMotorServer_with_hardcoded_config.ino