Tutorial.TwoPortReceive History

Hide minor edits - Show changes to output

December 01, 2011, at 02:50 PM by Scott Fitzgerald -
Changed line 19 from:
%height=250px%[[Attach:Arduino_bb.png | Attach:Arduino_bb.png]]
to:
%height=250px%[[Attach:Arduino_bb.png | Attach:Arduino_bb.png ]]
November 16, 2011, at 04:40 AM by Scott Fitzgerald -
Changed line 27 from:
(:source http://arduino.cc/en/pub/code/new-extension/libraries/SoftwareSerial/examples/TwoPortReceive/TwoPortReceive.ino lang=arduino tabwidth=4:)
to:
(:source http://arduino.cc/en/pub/code/master/libraries/SoftwareSerial/examples/TwoPortReceive/TwoPortReceive.ino lang=arduino tabwidth=4:)
September 14, 2011, at 09:03 PM by Scott Fitzgerald -
Changed lines 7-9 from:
In the example below, digital pins 2 and 4 on your Arduino are used as virtual RX serial lines. Pins 3 and 5 are virtual TX lines. The Arduino listens on one virtual port (ss) until it receives a "?" character. After that, it listens on the second virtual port (ss2).

to:
In the example below, digital pins 2 and 4 on your Arduino are used as virtual RX serial lines. Pins 3 and 5 are virtual TX lines. The Arduino listens on one virtual port (portOne) until it receives a "?" character. After that, it listens on the second virtual port (portTwo).

September 14, 2011, at 09:01 PM by Scott Fitzgerald -
Added lines 1-38:
''Examples > Software Serial Library''

!!!Two Port Receive

Arduinos have built in support for serial communication on pins 0 and 1, but what if you need more serial ports? [[ Reference/SoftwareSerial | '''The SoftwareSerial Library''']] has been developed to allow serial communication to take place on the other digital pins of your Arduino, using software to replicate the functionality of the hardwired RX and TX lines. This can be extremely helpful when the need arises to communicate with two serial enabled devices, or to talk with just one device while leaving the main serial port open for debugging purpose.

In the example below, digital pins 2 and 4 on your Arduino are used as virtual RX serial lines. Pins 3 and 5 are virtual TX lines. The Arduino listens on one virtual port (ss) until it receives a "?" character. After that, it listens on the second virtual port (ss2).


(:div class=BOM :)
!!!Hardware Required
* Arduino Board
(:divend:)

!!!Circuit
(:div class=circuit :)
There is no circuit for this example. Make sure that your Arduino is attached to your computer via USB to enable serial communication.

%height=250px%[[Attach:Arduino_bb.png | Attach:Arduino_bb.png]]
[-image developed using [[http://www.fritzing.org |Fritzing]]. For more circuit examples, see the [[http://fritzing.org/projects/|Fritzing project page]] -]

(:divend:)

!!!Code
(:div class=code :)

(:source http://arduino.cc/en/pub/code/new-extension/libraries/SoftwareSerial/examples/TwoPortReceive/TwoPortReceive.ino lang=arduino tabwidth=4:)

(:divend:)

!!!See also


* [[Reference/SoftwareSerial | The Software Serial Library]]
* [[MultiSerialMega]]: use two of the serial ports available on the Arduino Mega.
* [[Tutorial/Serial Call Response]]: send multiple vairables using a call-and-response (handshaking) method.
* [[Tutorial/Serial Call Response ASCII]]: send multiple variables using a call-and-response (handshaking) method, and ASCII-encode the values before sending.

Share