Skip to content

NeoSWSerial cannot read from multiple instances #59

Description

@KeerthiNadella

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions