int red=2; void setup() { // put your setup code here, to run once: Serial.begin(38400); pinMode (red,OUTPUT); } void loop() { // put your main code here, to run repeatedly: byte x=Serial.read() ; //recieve the signal from the other chip Serial.println(x); switch(x){ case (1):{ //FISRT case is to turn the red LED off (recieved 1 from the master) digitalWrite(red,LOW); } break; case (2):{ //SECOND case is to light the red LED when the signal is too high (recieved 2 from the master) digitalWrite(red,HIGH); }} }