how to send and receive on software serial between two devices (Pro Mini)?

Hello all, I am testing multiple software serial on a few Arduino ProMini units, and I am using a pre-coded sketch "Software Serial Example". However the sketch mentions:

"Receives from the hardware serial, sends to software serial. Receives from software serial, sends to hardware serial."

How could I do all my send and receive on software then between any two devices? Also, how would I test this? Could I use a simple LED connection (e.g. each time I listen for one port before giving it up and go to the other port)?

Many thanks for your help.

Karim.

Yes, the led idea looks good. But if you are connecting only two devices, why dont you use hardware serial?

I found that SW serial between two Nanos worked fine. Just initialize both, using the Rx/Tx pins in the initialization line, and initialize the other same way. Be sure that Tx from one device goes to Rx of the other, and vice versa, be sure they are both set for the same baud rate, and use the available(), read() and write() functions of the SW serial library. I had no problem at all with this. Good luck.

Thank you for your info, could you be more specific? I have connected pins 2 and 3 of the first to 3 and 2 of the second. By initialization do you mean introducing them as:


#include <SoftwareSerial.h>

SoftwareSerial portOne(2, 3); // RX, TX
SoftwareSerial portTwo(4, 5); // RX, TX


such as the above?

I am hoping to hear from you on a more generic approach to turn virtually any two pins to a RX/TX. I appreciate any help.
Karim.