//this is Brandon's code int outPin = 0; int incomingByte; void setup() { // put your setup code here, to run once: Serial.begin(9600); pinMode(outPin, OUTPUT); } void loop() { // put your main code here, to run repeatedly: if (Serial.available() > 0) { incomingByte = Serial.read(); incomingByte = incomingByte - '0'; //you are sending bytes not ascii so you dont' have to subtract anything if (incomingByte == 1){ digitalWrite(outPin, HIGH); } else if (incomingByte == 2){ digitalWrite(outPin, LOW); } else if (incomingByte == 3){ digitalWrite(outPin, HIGH); delay(500); digitalWrite(outPin, LOW); delay(500); digitalWrite(outPin, HIGH); delay(500); digitalWrite(outPin, LOW); delay(500); } } }