Hello Rui and Sara!
I want to control a stepper motor by partly using an html button to move to predetermined steps and partly with a mechanical button to optional values.
My problem is how can I add the mechanical buttons (inputs) so that the html buttons show when the mechanical buttons are pressed?
I'm just interested how to send information about a mechanical button press so that I can use the message to change the color of the html button.
I think I can handle styling and stepper code myself, but I haven't understood web sockets yet.
1 Answers
Hi.
You need to use websockets.
You can use this tutorial as a reference to learn how to send messages via websocket protocol from the server to the client:
Then, instead of displaying the received data, you’ll analyze the received data and use javascript to change the look of your button.
I hope this helps.
Regards,
Sara