// Here i have defined the LED buttons which are connected to my arduino int Blue=8; int Red=10; void setup() { // Here you must added serial begin in order to interface Serial.begin(9600); // Here the LED's are defined as an OUTPUT pinMode (Red,OUTPUT); pinMode (Blue,OUTPUT); } void loop() { int x=Serial.read() ; // This code is for Blinking the LED's and in cases so you can recognize which LED you are using switch(x){ case ('A'):{ digitalWrite (Red ,HIGH); delay (100); digitalWrite (Red,LOW); delay (100); digitalWrite (Red,HIGH); delay (100); digitalWrite (Red,LOW); delay (100); } break; case ('B'):{ digitalWrite (Blue,HIGH); delay (100); digitalWrite (Blue,LOW); delay (100); digitalWrite (Blue,HIGH); delay (100); digitalWrite (Blue,LOW); delay (100); } break; } }