const int redLED_L = 4; const int redLED_R = 14; const int greenLED = 9; const int button_L = 1; const int button_R = 16; const char selfID = '0'; // Jacob const char madisonID = '1'; const char kevinID = '2'; void setup() { // put your setup code here, to run once: pinMode(redLED_L,OUTPUT); pinMode(redLED_R,OUTPUT); pinMode(greenLED,OUTPUT); pinMode(button_L,INPUT); pinMode(button_R,INPUT); Serial.begin(9600); attachInterrupt(button_L,LPress,RISING); attachInterrupt(button_R,RPress,RISING); } void loop() { // put your main code here, to run repeatedly: if (Serial.available()>0){ char Data=Serial.read(); if (Data==selfID){ // digitalWrite(outpin1,HIGH); Data=Serial.read(); if (Data==madisonID){ // message sent by Madison digitalWrite(redLED_L,HIGH); delay(1000); digitalWrite(redLED_L,LOW); } else if (Data=kevinID){ // message sent by Kevin digitalWrite(redLED_R,HIGH); delay(1000); digitalWrite(redLED_R,LOW); } } delay(1000); // digitalWrite(outpin1,LOW); // digitalWrite(outpin2,LOW); } } void LPress() { Serial.print(madisonID); digitalWrite(greenLED,HIGH); delay(1000); } void RPress() { Serial.print(kevinID); digitalWrite(greenLED,HIGH); delay(1000); }