// James Rutter | 2021.05.13 // Networking and Communications // ATtiny412 Bridge #include SoftwareSerial mySerial(3,2); //RX, TX const int ledPin = 4; int v = 0; int nodeID = 1; //Node ID void setup() { mySerial.begin(115200); pinMode(ledPin, OUTPUT); } void loop() { mySerial.println("Startup Sequence..."); for(int i=1; i<=3; i++){ mySerial.println(i); delay(1000); } // wait while there is no data in the serial port while (mySerial.available() == 0){} v = mySerial.parseInt(); if(v == nodeID){ digitalWrite(ledPin, HIGH); delay(200); digitalWrite(ledPin, LOW); delay(200); } else{ digitalWrite(ledPin, LOW); } }