#define LED1 13
int incomingByte = 0;
void setup()
{
Serial.begin(9600);
pinMode(LED1,OUTPUT);
}
void loop(){
if (Serial.available() > 0) {
incomingByte = Serial.read();
if(incomingByte =='a')
{
digitalWrite(LED1,HIGH);
}
if(incomingByte =='b')
{
digitalWrite(LED1,LOW);
}
}
}