#define LED1 2
#define LED2 3
#define LED3 4
#define LED4 5
int incomingByte = 0;
void setup() {
Serial.begin(9600);
Serial.println("ArduinoAll");
pinMode(LED1,OUTPUT);
pinMode(LED2,OUTPUT);
pinMode(LED3,OUTPUT);
pinMode(LED4,OUTPUT);
}
void loop() {
if (Serial.available() > 0){
incomingByte = Serial.read();
if ( incomingByte == 'Q')
{
digitalWrite(LED1,1);
Serial.print(":LED1 is ON:");
}
if ( incomingByte == 'W')
{
digitalWrite(LED2,1);
Serial.print(":LED2 is ON:");
}
if ( incomingByte == 'E')
{
digitalWrite(LED3,1);
Serial.print(":LED3 is ON:");
}
if ( incomingByte == 'R')
{
digitalWrite(LED4,1);
Serial.print(":LED4 is ON:");
}
if ( incomingByte == 'A')
{
digitalWrite(LED1,0);
Serial.print(":LED1 is OFF:");
}
if ( incomingByte == 'S')
{
digitalWrite(LED2,0);
Serial.print(":LED2 is OFF:");
}
if ( incomingByte == 'D')
{
digitalWrite(LED3,0);
Serial.print(":LED3 is OFF:");
}
if ( incomingByte == 'F')
{
digitalWrite(LED4,0);
Serial.print(":LED4 is OFF:");
}
}
}