Connect Multiple (User) Controllers to 1 Arduino..?

Hello everyone!

I am new to the Arduino society, but I do have a processing background :slight_smile: Is it possible to connect multiple (user) controllers to 1 arduino.?
I would like to make clocks which work like during a chess-game...

example:

arduino
-player 1
--a button (for stopping your clock)
--8 led segments (for displaying the personal clock)

-player 2
-- a button (for stopping your clock)
-- 8 led segments (for displaying the personal clock).

etc. etc.

So is it possible to route the actions of multiple users through an arduino, to send an recieve personal data to/from the program? :slight_smile:

So is it possible to route the actions of multiple users through an arduino, to send an recieve personal data to/from the program?

The Arduino won't know or care who is pushing the switch or viewing the 8 LED segment displays (8? usually they are 7 segment displays).

So, yes, it is possible.

hmm hmm, ok, so it is possible to add an x amount of players (thus, a combination of a button and a display) to the arduino, and it can dynamicly link this to the amount of player-objects in the software... :slight_smile:

Since you have processing back ground, I can say this:

Create one button object and one display object with the appropriate libraries so you get x amount of buttons and x amount of displays.
Then this part is probably different from processing, you may need to poll all the button objects to see which gets pressed and determine the appropriate action (start or stop clock) and update the display:

while(1)
{
check buttons
update clocks
}

You should be able to expand to many players with the total 18 arduino I/O pins, depending on what display you use.

Maybe not 18, he will need some for controlling the time(s) displayed.
Of course, that can be a series of shift registers.
Could use the SPI pins SCK, MOSI, SS for that, and use MISO for reading in the state of shift-in registers to detect button presses.
So write a void loop that does this every 10mS:
See if 1 second has elapsed and update the appropriate digit(s) for whose ever clock is running.
Read in the shift-in register and see of anyone has pushed a button; if a timer is running, stop it & start the opposing players timer, stop counting if time has reached 0, if Reset has been pressed for a pair of players reset the time & wait for a start press, if Pause has been pressed for a pair of players then stop the time and wait for the player whose turn it is to press their start button to resume their time.
Then can use the other pins to have a set of hard coded times to use, selectable by player, or use one if liudr's LCD shields to have a menu to select times from, etc.

Can have all kinds of fun with this. Think big!

eh, wow, that is some technical information...

hmm, ok, so the program should check for every button press, and updates every display which should be updated.
the amount of 'software buttons&displays' should depend on the amount of connected buttons&displays.

Is it possible to create a 'plug-and-play' controller (thus a button, and a display) which easily can be connected to the arduino, and determines the amount of 'software players'...

Is it possible to create a 'plug-and-play' controller (thus a button, and a display) which easily can be connected to the arduino, and determines the amount of 'software players'...

No, it is not. There is no difference, as far as the Arduino is concerned, between reading a pin that has nothing attached, and reading a pin that has something attached.

You will need to figure out a different way to determine the number of players.

Sure, there are ways to do that.
I am envisioning a system where you have a box with buttons and display, and they can be daisy chained along. At the end of the chain, the Serial Data line for data to be read back (the button state) is pulled low. On startup the, the arduino shifts in for some number of bytes, say 16 if you had 16 boxes.
If a box existed, its buttons will be high on initial power up. So when the arduino starts seeing lows come back, it knows it has reached the end.

You can have a bunch of pins pulled high and plug the button display pad into a socket to pull the pin low. Then arduino know which socket is occupied.

I suppose the detection method would depend on the 'network' configuration to be used - individual detection pins could work well if the display/button controls emanated from a central configuration in a star pattern, where one box was independent of any other box.
The long shift register method would work better with all the boxes daisy chained along, say down a string of tables as you might see at a chess tournament.