int led = 13;
 
const char *voiceBuffer[] =
{
    "Turn on the light",
    "Turn off the light",
    "Play music",
    "Pause",
    "Next",
    "Previous",
    "Up",
    "Down",
    "Turn on the TV",
    "Turn off the TV",
    "Increase temperature",
    "Decrease temperature",
    "What's the time",
    "Open the door",
    "Close the door",
    "Left",
    "Right",
    "Stop",
    "Start",
    "Mode 1",
    "Mode 2",
    "Go",
};
 
void setup() {
  Serial.begin(9600);   // USB serial (for Serial Monitor)
  Serial1.begin(9600);  // Hardware serial on pins 0 (RX1) and 1 (TX1)
}
 
void loop()
{
    char cmd;
 
    if(Serial1.available())
    {
        cmd = Serial1.read();
        Serial.println(voiceBuffer[cmd - 1]);

        if((voiceBuffer[cmd - 1]) == "Turn on the light"){
          digitalWrite(led,HIGH);
        }
        else if((voiceBuffer[cmd - 1]) == "Turn off the light"){
          digitalWrite(led,LOW);
        }
    }
}
