Setup HC-05 Bluetooth Module with Arduino Nano
Circuit:-
Code:-
#include "SoftwareSerial.h"
SoftwareSerial BTSerial(5, 6); // RX | TX
void setup()
{
Serial.begin(9600);
Serial.println("Enter AT commands:");
BTSerial.begin(38400); // HC-05 default speed in AT command more
}
void loop()
{
if (BTSerial.available()) // read from HC-05 and send to Arduino Serial Monitor
Serial.write(BTSerial.read());
if (Serial.available()) // Keep reading from Arduino Serial Monitor and send to HC-05
BTSerial.write(Serial.read());
}
Output:-
Pls add a demo for bluetooth to serial pass through , node to node communications and node to mobile app communication.
ReplyDelete