const int ledPin = 11; //For connection to externally wired LED on Pin 11 char InChar; void setup(){ Serial.begin(115200); //Initialize Serial port 0. Serial Monitor is open on Serial port 0 Serial1.begin(9600); //Initialize Serial port 1. RX, TX serial communication is open on Serial port 1 pinMode(ledPin,OUTPUT); pinMode(GREEN_LED,INPUT); } void loop(){ if(Serial1.available()>0) { InChar=Serial1.read(); Serial.print(InChar); if( InChar == 'H') { digitalWrite(ledPin, HIGH); } else if(InChar == 'L') { digitalWrite(ledPin, LOW); } delay(1); } }