Using 1 PS2 Controller with multiple robots

Hello Everyone,

I am trying to utilise the lynxmotion wireless ps2 controller to control 2 robots, both using BotBoard 2 and Basic Atom Pro. I would like to be able to press a button on the controller which will toggle between the 2 robots allowing me to control them separately without needing to use 2 controllers.
Do you know if this is possible as I cannot think of a way. Not sure if theres a way for 1 controller to be connected to multiple devices at the same time.

Kind Regards
John

It’s certainly possible. The code in each robot would need to be slightly different - one would be waiting for a specific button and the other would wait for a different button.

For example (in bad pseudo code) on one robot:
if (X button pressed), then proceed with code walk
if (square button pressed), stop walking and do nothing
if (triangle button pressed), stop walking and do nothing
if (circle button pressed), stop walking and do nothing

While on the second robot:
if (X button pressed), stop walking and do nothing
if (square button pressed), then proceed with code walk
if (triangle button pressed), stop walking and do nothing
if (circle button pressed), stop walking and do nothing

Thank you for your quick response.

One of the robots is the Tri-Track with an arm. This means that almost all the buttons are already used before even considering the secondary robot. Would there be a way that I could utilise say the select button to toggle through which robot is being used?

Same way - you simply need to have each robot waiting for a specific command to start, and turn off when it receives the other robot’s command.

What I am not sure about here, is your setup. That is, do you have both robots connected to each other and there is only one PS2 transmitter and Receiver? Or do you have two separate robots and you wish for each robot to have their own PS2 controller and at the receiver you wish to choose which robot will respond to the transmitter?

If connected to one receiver, than Coleman has given you a good way to do so.

If the later, I don’t know if there is a way to choose which receiver will work at a time. It is my understanding of PS2s, that the transmitter and receiver will bind with each other at power up, once they bind up, the only way I know to then choose a different robot, is to power down the robot and transmitter, then power up the new robot and turn on the remote… Which I am guessing you don’t wish to do.

You can do this type of thing with Remotes that are XBee based, like our DIY remotes, as you can have the transmitter change who it is talking to by changing the destination (DL (and maybe DH) if in serial replacement mode, or by changing the destination in the packets if you are using packet mode).

Good Luck
Kurt