Arduino Multiple Serial
Hi everyone, I really need your help. Okay I have several sensor and I need to get them work together on Arduino UNO board although I know Arduino Mega is capable of holding up to 4 rx/tx but I want to test out on UNO board.
A quick introduction to the Arduino IDE's improved Serial Plotter, introduced in version 1.6.7. The Plotter is now able to draw several graphs at one, based on multiple values sent by Serial. The Mind of Bill Porter > Tutorials > How to Add Multiple Serial Connections to your Custom Arduino Board or What Those 1k Resistors Do.
Multiple Serial Output Arduino
I'm using an Arduino mega which has 4 serial ports. On the main serial port continuously sending and receiving data between the Arduino and a computer. The computer is doing some calculations and sending the results back to the arduino.
I'd like to see the data that the Arduino is receiving from the computer but doing a normal Serial.print() will also send that data back to the computer, creating a big endless loop of garbage data.

Is there a way to print to the screen using on of the other serial ports. I'm thinking that I can read/write on port1 and then send the data back to the screen using port2?
dsolimano1 Answer
I don't own a Mega myself, so take this with a grain of salt, but as far as i know, the three additional serial ports are not connected to the USB-to-serial port. Serial1-Serial3 can only be used to communicate with other devices by connecting TX(Mega) with RX(device) and vice versa.
OK, since i didn't know exactly, i had a look at the Arduino Mega specs.It says:
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). Used to receive (RX) and transmit (TX) TTL serial data. Pins 0 and 1 are also connected to the corresponding pins of the FTDI USB-to-TTL Serial chip.
Sorry for the bad news.
Klaus-Dieter WarzechaKlaus-Dieter WarzechaNot the answer you're looking for? Browse other questions tagged serial-portarduino or ask your own question.
In this project I will be using multiple ESP8266 WiFi modules (4) connected by software serial to an Arduino Leonardo Micro (1 UART). I plan to rotate between all 4 (starting with 2): Open port, write, read response, close port, move on..
This is a very barebones version of my code to address this one issue. Works flawlessly with a single (always open) connection, but it does not work when I close Ser1 (even if I don't start Ser2!!!)Is the xxxx.end(); command broken or something?Or am I doing something wrong? :/
Note: This code sends 'AT' to the module, it responds with 'OK'


When adding Ser2, LED flashes on Arduino periodically indicating it is writing to serial monitor, but nothing appears..
Code:
1 Answer
As Ignacio mentions, you should not be stopping and starting the serial ports. Instead just switch between them with .listen():
Enables the selected software serial port to listen. Only one software serial port can listen at a time; data that arrives for other ports will be discarded. Any data already received is discarded during the call to listen() (unless the given instance is already listening).
Adobe fireworks free crack giveaway. So your code would be written as:
Majenko♦Majenko