I am relatively new to the arduino world and had a question.
I am using 2 arduinos to talk to each other via software serial. I am able to get each arduino to talk to each other with no problems.
My question is, is it possible to dynamically set which pin is RX and TX so that each micro can be wired the same. Right now i have both arduinos set up on pins 10 and 11. sender and receiver respectively. So it would be wired like this:
10 -> 11
11 -> 10
So if i have a wire running from pin 11 on one micro to pin 11 on another micro and the same on pin 10.. like this:
10 -> 10
11 -> 11
i want to auto detect which one will be the sender and which would be the receiver. Is this possible?
thanks ahead of time, hopefully my question is clear.
My end goal is to scale this up, so lets say i have 5 arduino micros i want to link them all together and have them decide which pins will send and which will recieve. I could then disconnect one and move it to another and it would still communicate.
Hard problem alas - identical participants need to establish order whilst all running
the same code. This is why ethernet isn't trivial for instance. Welcome to the
world of protocol design.
Separately from your Pin question, I think you will run into problems with more than 2 Arduinos because 2 copies of SoftwareSerial don't work very well on the same Arduino.