/*#include <SoftwareSerial.h>
#define led 3
SoftwareSerial HC06(2,3);
SoftwareSerial BTSerial(bt_RX, bt_TX);
void setup()
{
HC06.begin(9600);
Serial.begin(9600);
}
void loop()
{
if (HC06.available()) {
Serial.write(HC06.read());
}
if (Serial.available()) {
HC06.write(Serial.read());
}
}*/
/*Wireless Light Controller*/
#include <SoftwareSerial.h>
SoftwareSerial HC06(2,3);
char Incoming_value = 0;
#define led 5
void setup() {
Serial.begin(9600); // Start serial communication with the Serial Monitor
HC06.begin(9600);
pinMode(5,OUTPUT);
}
void loop() {
// put your main code here, to run repeatedly:
if (Serial.available() > 0)
{
Incoming_value = Serial.read();
Serial.print(Incoming_value);
Serial.print("\n");
if (Incoming_value == '1')
digitalWrite(5,HIGH);
else if(Incoming_value == '0')
digitalWrite(5,LOW);
}
}
// HC-06 Bluetooth Module Connection: TX = 2, RX =3, and 5 V / GND
// In Arduino IDE Serial Monitor, set 'No Line Ending'
// Enter 'AT' to get 'OK' response, then
// Enter 'AT+NAMEBT1234' to set HC-06 Module Name to 'BT1234'
// Enter 'AT+PIN1234' to set HC-06 Module PIN to '1234'
// Recommended Smartphoe App for connection is
// Arduino Bluetooth Control by broxcode
uno:A5.2
uno:A4.2
uno:AREF
uno:GND.1
uno:13
uno:12
uno:11
uno:10
uno:9
uno:8
uno:7
uno:6
uno:5
uno:4
uno:3
uno:2
uno:1
uno:0
uno:IOREF
uno:RESET
uno:3.3V
uno:5V
uno:GND.2
uno:GND.3
uno:VIN
uno:A0
uno:A1
uno:A2
uno:A3
uno:A4
uno:A5
chip1:RXD
chip1:TXD
chip1:GND
chip1:VCC
led1:A
led1:C
r1:1
r1:2