 
// constants won't change. Used here to 
// set pin numbers:
const int ledPin =  13;      // the number of the LED pin
const int ledPin1 =  12;      // the number of the LED pin
const int ledPin2 =  11;      // the number of the LED pin
const int ledPin3 =  10;      // the number of the LED pin
const int ledPin4 =  9;      // the number of the LED pin
const int ledPin5 =  8;      // the number of the LED pin

// Variables will change:
int ledState = HIGH;             // ledState used to set the LED
long previousMillis = 0;        // will store last time LED was updated

// the follow variables is a long because the time, measured in miliseconds,
// will quickly become a bigger number than can be stored in an int.

long interval = 100;           // interval at which to blink (milliseconds)

void setup() {
  // set the digital pin as output:
  pinMode(ledPin, OUTPUT); 
  pinMode(ledPin1, OUTPUT); 
  pinMode(ledPin2, OUTPUT); 
  pinMode(ledPin3, OUTPUT); 
  pinMode(ledPin4, OUTPUT); 
  pinMode(ledPin5, OUTPUT);
  
  /*digitalWrite(ledPin, HIGH); 
    digitalWrite(ledPin1, HIGH); 
    digitalWrite(ledPin2, HIGH); 
    digitalWrite(ledPin3, HIGH); 
    digitalWrite(ledPin4, HIGH); 
    digitalWrite(ledPin5, HIGH);
  */
  
  
  delay(1000);

 
  Serial.begin(9600); 

}

void loop()
{
  
  if(Serial.available() > 0)
  {
  char lettre= Serial.read();

    switch(lettre){
    
    case 'A':
    
    digitalWrite(ledPin, LOW);
    digitalWrite(ledPin1, ledState);
    digitalWrite(ledPin2, LOW);
    digitalWrite(ledPin3, LOW);
    digitalWrite(ledPin4, LOW);
    digitalWrite(ledPin5, LOW);
    break;

    case 'B':
    
    digitalWrite(ledPin, LOW);
    digitalWrite(ledPin1, ledState);
    digitalWrite(ledPin2, ledState);
    digitalWrite(ledPin3, LOW);
    digitalWrite(ledPin4, LOW);
    digitalWrite(ledPin5, LOW);
    break;
    
    case 'C':
    
    digitalWrite(ledPin, ledState);
    digitalWrite(ledPin1, ledState);
    digitalWrite(ledPin2, LOW);
    digitalWrite(ledPin3, LOW);
    digitalWrite(ledPin4, LOW);
    digitalWrite(ledPin5, LOW);
    break;
    
     case 'D':
    
    digitalWrite(ledPin, ledState);
    digitalWrite(ledPin1, ledState);
    digitalWrite(ledPin2, LOW);
    digitalWrite(ledPin3, ledState);
    digitalWrite(ledPin4, LOW);
    digitalWrite(ledPin5, LOW);
    break;
    
     case 'E':
    
    digitalWrite(ledPin, LOW);
    digitalWrite(ledPin1, ledState);
    digitalWrite(ledPin2, LOW);
    digitalWrite(ledPin3, ledState);
    digitalWrite(ledPin4, LOW);
    digitalWrite(ledPin5, LOW);
    break;
    
      case 'F':
    
    digitalWrite(ledPin, ledState);
    digitalWrite(ledPin1, ledState);
    digitalWrite(ledPin2, ledState);
    digitalWrite(ledPin3, LOW);
    digitalWrite(ledPin4, LOW);
    digitalWrite(ledPin5, LOW);
    break;
    
       case 'G':
    
    digitalWrite(ledPin, ledState);
    digitalWrite(ledPin1, ledState);
    digitalWrite(ledPin2, ledState);
    digitalWrite(ledPin3, ledState);
    digitalWrite(ledPin4, LOW);
    digitalWrite(ledPin5, LOW);
    break;
    
     case 'H':
    
    digitalWrite(ledPin, LOW);
    digitalWrite(ledPin1, ledState);
    digitalWrite(ledPin2, ledState);
    digitalWrite(ledPin3, ledState);
    digitalWrite(ledPin4, LOW);
    digitalWrite(ledPin5, LOW);
    break;
    
     case 'I':
    
    digitalWrite(ledPin, ledState);
    digitalWrite(ledPin1, LOW);
    digitalWrite(ledPin2, ledState);
    digitalWrite(ledPin3, LOW);
    digitalWrite(ledPin4, LOW);
    digitalWrite(ledPin5, LOW);
    break;
    
    case 'J':
    
    digitalWrite(ledPin, ledState);
    digitalWrite(ledPin1, LOW);
    digitalWrite(ledPin2, ledState);
    digitalWrite(ledPin3, ledState);
    digitalWrite(ledPin4, LOW);
    digitalWrite(ledPin5, LOW);
    break;
    
      case 'K':
    
    digitalWrite(ledPin, LOW);
    digitalWrite(ledPin1, ledState);
    digitalWrite(ledPin2, LOW);
    digitalWrite(ledPin3, LOW);
    digitalWrite(ledPin4, LOW);
    digitalWrite(ledPin5, ledState);
    break;
    
    case 'L':
    
    digitalWrite(ledPin, LOW);
    digitalWrite(ledPin1, ledState);
    digitalWrite(ledPin2, ledState);
    digitalWrite(ledPin3, LOW);
    digitalWrite(ledPin4, LOW);
    digitalWrite(ledPin5, ledState);
    break;
    
    case 'M':
    
    digitalWrite(ledPin, ledState);
    digitalWrite(ledPin1, ledState);
    digitalWrite(ledPin2, LOW);
    digitalWrite(ledPin3, LOW);
    digitalWrite(ledPin4, LOW);
    digitalWrite(ledPin5, ledState);
    break;
    
    case 'N':
    
    digitalWrite(ledPin, ledState);
    digitalWrite(ledPin1, ledState);
    digitalWrite(ledPin2, LOW);
    digitalWrite(ledPin3, ledState);
    digitalWrite(ledPin4, LOW);
    digitalWrite(ledPin5, ledState);
    break;
    
    case 'O':
    
    digitalWrite(ledPin, LOW);
    digitalWrite(ledPin1, ledState);
    digitalWrite(ledPin2, LOW);
    digitalWrite(ledPin3, ledState);
    digitalWrite(ledPin4, LOW);
    digitalWrite(ledPin5, ledState);
    break;
    
     case 'P':
    
    digitalWrite(ledPin, ledState);
    digitalWrite(ledPin1, ledState);
    digitalWrite(ledPin2, ledState);
    digitalWrite(ledPin3, LOW);
    digitalWrite(ledPin4, LOW);
    digitalWrite(ledPin5, ledState);
    break;
    
    case 'Q':
    
    digitalWrite(ledPin, ledState);
    digitalWrite(ledPin1, ledState);
    digitalWrite(ledPin2, ledState);
    digitalWrite(ledPin3, ledState);
    digitalWrite(ledPin4, LOW);
    digitalWrite(ledPin5, ledState);
    break;
    
     case 'R':
    
    digitalWrite(ledPin, LOW);//3
    digitalWrite(ledPin1, ledState);
    digitalWrite(ledPin2, ledState);
    digitalWrite(ledPin3, ledState);
    digitalWrite(ledPin4, LOW);//1
    digitalWrite(ledPin5, ledState);
    break;
    
     case 'S':
    
    digitalWrite(ledPin, ledState);
    digitalWrite(ledPin1, LOW);
    digitalWrite(ledPin2, ledState);
    digitalWrite(ledPin3, ledState);
    digitalWrite(ledPin4, LOW);
    digitalWrite(ledPin5, ledState);
    break;
    
     case 'T':
    
    digitalWrite(ledPin, ledState);
    digitalWrite(ledPin1, LOW);
    digitalWrite(ledPin2, ledState);
    digitalWrite(ledPin3, ledState);
    digitalWrite(ledPin4, LOW);
    digitalWrite(ledPin5, ledState);
    break;
    
    case 'U':
    
    digitalWrite(ledPin, LOW);
    digitalWrite(ledPin1, ledState);
    digitalWrite(ledPin2, LOW);
    digitalWrite(ledPin3, LOW);
    digitalWrite(ledPin4, ledState);
    digitalWrite(ledPin5, ledState);
    break;
    
     case 'V':
    
    digitalWrite(ledPin, LOW); //3
    digitalWrite(ledPin1, ledState);
    digitalWrite(ledPin2, ledState);
    digitalWrite(ledPin3, LOW);
    digitalWrite(ledPin4, ledState);//1
    digitalWrite(ledPin5, ledState);
    break;
    
    case 'W':
    
    digitalWrite(ledPin, ledState);
    digitalWrite(ledPin1, LOW);
    digitalWrite(ledPin2, ledState);
    digitalWrite(ledPin3, ledState);
    digitalWrite(ledPin4, ledState);
    digitalWrite(ledPin5, LOW);
    break;
    
     case 'X':
    
    digitalWrite(ledPin, ledState);
    digitalWrite(ledPin1, ledState);
    digitalWrite(ledPin2, LOW);
    digitalWrite(ledPin3, LOW);
    digitalWrite(ledPin4, ledState);
    digitalWrite(ledPin5, ledState);
    break;
    
    case 'Y':
    
    digitalWrite(ledPin, ledState);
    digitalWrite(ledPin1, ledState);
    digitalWrite(ledPin2, LOW);
    digitalWrite(ledPin3, ledState);
    digitalWrite(ledPin4, ledState);
    digitalWrite(ledPin5, ledState);
    break;
    
     case 'Z':
    
    digitalWrite(ledPin, LOW);
    digitalWrite(ledPin1, ledState);
    digitalWrite(ledPin2, LOW);
    digitalWrite(ledPin3, ledState);
    digitalWrite(ledPin4, ledState);
    digitalWrite(ledPin5, ledState);
    break;
    
   }

  delay(1000);

    digitalWrite(ledPin, LOW);
    digitalWrite(ledPin1, LOW);
    digitalWrite(ledPin2, LOW);
    digitalWrite(ledPin3, LOW);
    digitalWrite(ledPin4, LOW);
    digitalWrite(ledPin5, LOW);
}
     }
     
  
