const int ledPin = 2; const int rxPin = 1; const int txPin = 0; int incomingByte = 0; void setup() { // put your setup code here, to run once: #define node_id '1' pinMode(ledPin, OUTPUT); pinMode(txPin,INPUT); Serial.begin(115200); } void loop() { // put your main code here, to run repeatedly: if (Serial.available() > 0) { // read the incoming byte: incomingByte = Serial.read(); } // say what you got: if (incomingByte == node_id) { digitalWrite(ledPin, HIGH); pinMode(txPin,OUTPUT); digitalWrite(txPin, HIGH); Serial.print("node:"); Serial.println(node_id); delay(1000); digitalWrite(ledPin, LOW); pinMode(txPin,INPUT); } }