#include //Include SoftwareSerial library SoftwareSerial myBLUETOOTH(0,1);//define SoftwareSerial RX first then TX #define LED 2 // Define on board LED connected to pin 2 char state; // Define a variable to save the reads char void setup() { myBLUETOOTH.begin(9600); // Begin SoftwareSerial pinMode(LED,OUTPUT); // sets LED pin as OUTPUT pin } void loop() { if (myBLUETOOTH.available()){ // if SoftwareSerial recived any data state = myBLUETOOTH.read(); //Reads the received char and store it at "state" if(state == 'Y') // If you recived Y digitalWrite(LED, HIGH); //Turn LED on if(state == 'N'){ // If you recived n digitalWrite(LED, LOW);//Turn LED off } } }