SlashDevin / NeoSWSerial

Efficient alternative to SoftwareSerial with attachInterrupt for RX chars, simultaneous RX & TX
169 stars 42 forks source link

NeoSWSerial cannot read from multiple instances #59

Open KeerthiNadella opened 3 months ago

KeerthiNadella commented 3 months ago

i'm using two neoswserials. NeoSWSerial mySerial1( 5, 4); NeoSWSerial mySerial2( 6, 8);

void loop(){

//mySerial2.ignore(); //mySerial1.listen(); if (mySerial1.available()) {

char data = mySerial1.read(); // Read the incoming byte
// Process the received data from port 1
Serial.print("Data from port 1: ");
flagserial = 1;

processReceivedChar(data);
updateCurrent();

}

//mySerial1.ignore(); //mySerial2.listen(); if (mySerial2.available()) {

char data = mySerial2.read();// Read the incoming byte // Process the received data from port 2 Serial.print("Data from port 2: "); flagserial = 2;

processReceivedChar(data); updateCurrent(); }

}

the above code is my loop function. but the values are read only from one serial

can anyone help with this