/* use Relay module and HC06 bluetooth receiver to turn on/off LEd wirlessly * circuit and tutorial url http://osoyoo.com/?p=615 */ int relay = 10; void setup() { Serial.begin (9600); pinMode(relay,OUTPUT); } void loop() { char val,old_val; val = Serial.read(); old_val=val; if (old_val=='1' ) { digitalWrite(relay,HIGH); } if(old_val=='0') { digitalWrite(relay,LOW); } }