Voting-based LED control?

Hi everyone,

I'm using an Arduino Yun and I was wondering how I should approach a voting-based LED control.

Let's say there are 2 LEDs attached to the Arduino, Red and Green. And there are 3 users controlling them. The LEDs are controllable through a webpage.

Here's the catch:
When User #1 tries to turn on Green LED, a notification will be sent to User #2 and User #3 ("User #1 wants to turn on Green LED. YES or NO?"). If User #2 and User #3 say YES, Green LED will be turned on. However, if they say NO, Green LED won't be turned on.

Any suggestions on how I can approach this?

Thanks a lot! :slight_smile:

And there are 3 users controlling them.

Do you have three different Arduinos or three buttons on one Arduino?

I think you will need to use AJAX type technology to receive events from the web server. That will need a web server capable of handling multiple resources and to me that implies a web server that publishes a web site stored on an SD card. There are examples of a suitable web server in the playground. The tricky part will be the need to support three simultaneous web clients. The common Arduino shields only support a limited number of concurrent connections (four is typical, I think) and some AJAX techniques require multiple connections, so you'll have to research AJAX frameworks such as jQuery and see if there's one you like which enables you to get away with one connection per client.