Serial.Begin statements

Hi...

I have a question regarding the use of multiple serial.begin () statements in one program? I have a program that requires it to begin a (9600
and the other to begin at (19200). What I want to do is have a serial.begin(19200) to make a phone call. The second serial.begin(9600) will "speak" something saved from an SD card, and I will send the audio via a cable from one shield to the other.

My question is: Can I have multiple serial.begins activated at the same time? And how can I have them interact with each other?

Thanks

How will the actual devices know when the incoming data isn't for them?

There are four functions in the Arduino IDE:

Serial.begin();
Serial1.begin();
Serial2.begin();
Serial3.begin();

(Serial4.begin(); and on doesn't exist)

This will permit you two establish several RX & TX lines. However this only works on the Arduino Due and Mega because they have more than on pair of RX TX pins.()

Here are the pins n the Due for example:
Serial: 0 (RX) and 1 (TX)
Serial 1: 19 (RX) and 18 (TX)
Serial 2: 17 (RX) and 16 (TX)
Serial 3: 15 (RX) and 14 (TX)

Multiple RX and TX communication is not supported on other Arduino Boards, sorry. :slight_smile:

mixania:
Multiple RX and TX communication is not supported on other Arduino Boards, sorry. :slight_smile:

Not in hardware.

There is still SoftwareSerial available. Depending on the device, this may be sufficient.

There is still SoftwareSerial available. Depending on the device, this may be sufficient.

So how would I go about using the SofwareSerial?

Didn't know that it is possible through software, but here is what the Library also says:

Not all pins on the Mega and Mega 2560 support change interrupts, so only the following can be used for RX: 10, 11, 12, 13, 50, 51, 52, 53, 62, 63, 64, 65, 66, 67, 68, 69
Not all pins on the Leonardo support change interrupts, so only the following can be used for RX: 8, 9, 10, 11, 14 (MISO), 15 (SCK), 16 (MOSI).

It talks about the Mega and the Leonardo but not about Arduino UNO for example. So is it actually not compatible with all models?

It was created for the Uno. Many, many projects use it.