// This Sketch works with 블루투스 LED 아두이노 내친구 App

#include <SoftwareSerial.h>
SoftwareSerial BT_Serial(7,8) ; // TX, RX 

int led = 13;

void setup() {
 BT_Serial.begin(9600);
 pinMode(led,OUTPUT);
 digitalWrite(led,LOW);
 Serial.begin(115200) ;
}
void loop() {
if(BT_Serial.available()){
  String Value = BT_Serial.readStringUntil('\n');
  BT_Serial.println(Value);
  Serial.println(Value) ;
  
  if( Value == "on" ) {
    digitalWrite(led,HIGH);
  }
  else if( Value == "off" ) {
    digitalWrite(led,LOW);
  }
 }
}