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

Switches connected to ESP32 #26

Closed une18 closed 3 years ago

une18 commented 3 years ago

How to connect button or switch to ESP32 for start, stop, left, right commands?

Is it possible to create a simple row of commands 1000 steps left, delay 2000ms, 2000 steps right, delay 1000ms....

I have a HW-040 rotary encoder, for some reason It did not work with the motor. Is it faulty, or....

pkerspe commented 3 years ago

Hi Une18, this is a software library reposiotory, not a hardware connectivity support forum :-)

To connect buttons to the ESP you need one GPIO Pin per button (unless you want to create matrix setup, which is probably not a good way to begin with). You connect one Pin of the Button/Switch to GND and the other PIn to the GPIO of the ESP. Then you configure the Pins as inputs with internal pullups enabled.

Yes, you can create "rows of commands" in a custom function you write in C++. You can use the blocking functions for moving the stepper, then using delay and moving again. All functions of the library are documented here: https://github.com/pkerspe/ESP-StepperMotor-Server#library-api-documentation

AS for the rotary encoder: with the little details provided there is nothing I can do to help, but maybe you should check in a hardware forum how to connect a rotary encoder.

une18 commented 3 years ago

I know how to wire the buttons, I did not find a way how to tell the software what one or the other button conneted to any GPIO pins should do.

I asked, for the switches, because I could not find information about it in the documentation. Still can not...

I wanted to know if it is possible to do all this in UI, I can not write code myself.

Will order another encoder. Would you reccommend a specific model?

pkerspe commented 3 years ago

Other than limit switch functionality and rotary encoders, additional switches and functionality are currently not supported to be created via the UI. The features you require need custom c++ code to be written. You are looking for the Marco-Functionality which is planned for some future release but not implemented yet. This feature will still take some time. See #19

une18 commented 3 years ago

Thank You!

I have the will, but not the skill :)