P5.bots connect arduino to public website

Hi all! I’m new to networking so bear with me. I want to be able to instantly control a public website through some sensor input on an arduino. Let say I want the color of the background to change when i push a physical button.

So far I have been able to use arduino + firmata + P5.js + P5.bots + node.js to make a website that responds instantly to a button press. See video here: https://www.dropbox.com/s/rznwdv9t7x2fyfn/boom.mp4?dl=0

This works fine on localhost on the pc connected to the arduino but i want this to work on a public website. How would i do this?

1 Like

JavaScript is client-side. You can use it to change a client-side site in a browser, but if you want to send a message that changes a how a public site appears in other browsers, then you need to send a message to the server and the server then needs to send a message to other clients.

For that, I believe that the basic p5.js examples are with node + socket.io – see for example: