igor123, you were told to use different Serial ports in a different thread. You can only use 1 Serial port per device. And how you call the ports depends on what Arduino board you have.
Uno only has one Serial port = HardwareSerial is pins(0,1) You can't change these pins as it's hardware dependent. So if you need another port you need the Software Serial Library. You need to call the SoftwareSerial by: SoftwareSerial mySerial(2, 3). Did you notice it was using different pins?
#include <SoftwareSerial.h>
SoftwareSerial mySerial(2, 3);
void setup(){
mySerial.begin(4800); //Software Serial port
Serial.begin(57600); //Hardware Serial port
}
void loop(){
if (mySerial.available())
Serial.write(mySerial.read());
if (Serial.available())
mySerial.write(Serial.read());
}
Arduino Mega has 4 Hardware Serial ports. So you can call them individually.
void setup(){
Serial.begin(9600);
Serial1.begin(11200);
Serial2.begin(8400);
Serial3.begin(87600);
}
void loop(){
.....
}