//Original code made by Pablo Nuñez, available at https://hackmd.io/@ihhYfPp3TlKoBY_QfN2kZQ/S13ZXYK9U //Translated and edited by Jonathan León //This code is for the slave(s) board(s), connect it to a breadboard with wires on RX, 5V and GND //on three different lines. //The master board uses almost the same connections but using the TX pin instead. //Connect the LED with the positive leg on the 13 pin and the negative leg on the next pin (GND). #define BUTTON_PIN 8 //Button char nodo = 'b'; //Name of this node void setup() { Serial.begin (9600); //Starts serial communication pinMode(13,OUTPUT); //Sets the LED as an input } void loop() { if (Serial.read() == nodo){ //If the name is called: digitalWrite (13,HIGH); //Turns LED on delay(500); //Shorter delay than master's Serial.println("Turno del B"); //For debugging purposes on serial monitor } else { //If the name has not been called: digitalWrite (13,LOW); //Turns LED off //delay (500); } }