Procedure
Read moreDownload the app called BlueControl (It’s free). Here is the linkOpen the app Blue control (It will automatically turn on the device’s Bluetooth). Go to options. Click on “Connect to Robot”. Choose the device – HC 05.
- Make the connections as shown in the above image. Don’t connect the RX & TX pins WHILE/BEFORE uploading the code !
- Copy the code given below.
- When you are connecting to the Bluetooth module for the first time, it will ask you the password. Enter 0000 OR 1234.
- When the device gets successfully paired with the sensor, the LED lights on sensor will start blinking at a slower rate than usual.
- DONE. Copy the code given below & test it out !
char data=0;
void setup(){
Serial.begin(9600);
pinMode(2,OUTPUT);
}
void loop(){
if (Serial.available()>0){
data = Serial.read();
Serial.print(data);
Serial.print("\n");
if(data=='1')
digitalWrite(2,HIGH);
else if (data=='0')
digitalWrite(2,LOW);
}
Comments