• Skip to main content
  • Skip to primary sidebar

RNTLab.com

The Ultimate Shortcut to Learn Electronics and Programming with Open Source Hardware and Software

  • Courses
  • Forum
    • Forum
    • Ask Question
  • Shop
  • Account
  • Blog
  • Login

2.5 – WebSocket Web Server: Control Multiple Outputs

Q&A Forum › Category: ESP32 › 2.5 – WebSocket Web Server: Control Multiple Outputs
0 Vote Up Vote Down
Mats asked 9 months ago
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.
Question Tags: Web socket
1 Answers
0 Vote Up Vote Down
Sara Santos Staff answered 9 months ago

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:

ESP32 WebSocket Server: Display Sensor Readings


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
 

Primary Sidebar

Login to Ask or Answer Questions

This Forum is private and it’s only available for members enrolled in our Courses.

Login »

Latest Course Updates

  • [New Edition] Build ESP32-CAM Projects eBook – 2nd Edition April 16, 2025
  • [eBook Updated] Learn ESP32 with Arduino IDE eBook – Version 3.2 April 16, 2025

You must be logged in to view this content.

Contact Support - Refunds - Privacy - Terms - MakerAdvisor.com - Member Login

Copyright © 2013-2025 · RandomNerdTutorials.com · All Rights Reserved

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.