Serial controlled led

Hello, everyone! I've got some relatively finished code for controlling an led on pin 13 with serial. To use it, you just upload to your Arduino, open the serial monitor, and type 0 and 1 to turn the led on or off. You can also type a sequence of zeros and ones to make it blink in a certain pattern. "01010101110001110001110101010" blinks "SOS" in Morse code.

// LEDSerialToggle
// Turns on an LED on for one second, then off for one second, repeatedly.
// Based on DarthTater's Morse code for serial. 
// Pin 13 has an LED connected on most Arduino boards.
// give it a name:
int LEDPin = 13;
int incomingByte = 0;

// the setup routine runs once when you press reset:
void setup() {                
  // initialize the digital pin as an output.
  pinMode(LEDPin, OUTPUT);
  Serial.begin(9600);
  Serial.flush(); 
}
// Let's have it turn the LED on (or off) when it gets input:
void LEDToggle(int c){
  switch(c)  
  {
  case 1:
    digitalWrite(LEDPin, HIGH); // This is the LED turning on when you press "1"
    return; 

  case 0:
     digitalWrite(LEDPin, LOW); // This is the LED turning off when you press "0"
     return; 
   }
 }
// the loop routine runs over and over again forever:
void loop() {
   
  if (Serial.available() > 0) {
    
    incomingByte = Serial.read();
    // read the incoming byte:
    LEDToggle(incomingByte);
    delay(400); // wait 0.4 seconds before going on to our next character.
  }
}

If you want to download it, you can get it at Dropbox - Error - Simplify your life.

" delay(400); // wait a fourth of a second before going on to our next character."

This is 0.4 seconds, not 1/4 (250ms) of a second.

Oh, glad you caught that!
That is why I use Dropbox, so I can update my code, typos, etc. Without actually having to redo and re-upload the whole thing again.
Hey, your designs are pretty cool! 8)