Whisti
Posts: 1
Joined: Sat Sep 24, 2016 8:16 pm

Multiple Inputs

Sat Sep 24, 2016 9:40 pm

I have a raspberry pi 3 and I am trying to program with python. My goal is to make a electronic board game. The pi will display on a screen lying on the table (lying down like the board of a board game) and the players will control their turn with touchscreens (one per person).

The place I need help is the multiple inputs from the touchscreens. I don't think I can attach 4 touchscreens to one pi, so the plan is to have a pi for each touchscreen. Then those 4 touchscreen pis communicate the needed info (x and y positions of clicks) with the pi running the game. Is this doable? Is there a better way to do this than what I have come up with?

An alternative route I have been looking into is "pi ui". It seems it is a way to interface a raspberry pi python program with a phone (i.e. touchscreen). But again I don't know if this can handle multiple inputs.

Thank you all for your help.

tom.slick
Posts: 190
Joined: Wed Jan 06, 2016 9:23 pm

Re: Multiple Inputs

Sun Sep 25, 2016 6:48 am

If you have multiple RPI's sending then you have a way to identify each. What does the code look like? Post an example of what you are doing.

PiGraham
Posts: 3665
Joined: Fri Jun 07, 2013 12:37 pm
Location: Waterlooville

Re: Multiple Inputs

Sun Sep 25, 2016 7:23 am

Whisti wrote:the plan is to have a pi for each touchscreen. Then those 4 touchscreen pis communicate the needed info (x and y positions of clicks) with the pi running the game. Is this doable? Is there a better way to do this than what I have come up with?
Yes, that is doable. Each Pi can send it's player ID along with the x,y or other move data.
Whisti wrote:An alternative route I have been looking into is "pi ui". It seems it is a way to interface a raspberry pi python program with a phone (i.e. touchscreen). But again I don't know if this can handle multiple inputs.
Yes, that could work. It's much the same as multiple Pis just on a different OS.

It is also possible to add touch screen sensing to large displays, or use other methods to detect playing pieces on a screen. See this discussion:

viewtopic.php?f=78&t=145293

Return to “Python”