     delay(300);
   }
 }
+
+void turnOn() {
+  digitalWrite(led, HIGH);  
+}
+
+void turnOff() {
+  digitalWrite(led, LOW);
+}

int inByte = 0;         // incoming serial byte

void setup()
{
  // start serial port at 9600 bps:
  Serial.begin(9600);
  while (!Serial) {

  if (Serial.available() > 0) {
    // get incoming byte:
    inByte = Serial.read();
    if(inByte == onMessage){
      turnOn();
    }
    if(inByte == offMessage){
      turnOff();
    }
  }
}

