Skip to content

Instantly share code, notes, and snippets.

@dehanjl
Created September 22, 2020 13:46
Show Gist options
  • Save dehanjl/e51327671808940eca267767a310ed17 to your computer and use it in GitHub Desktop.
Save dehanjl/e51327671808940eca267767a310ed17 to your computer and use it in GitHub Desktop.
Change AT settings of the HC-05
// Dehan Lamprecht, 2020
// Allows changing the settings of the HC-05 module
// Adapted from https://www.instructables.com/id/Program-an-Arduino-Wireless-Over-Bluetooth/
#include <SoftwareSerial.h>
SoftwareSerial BTSerial(2, 3); // RX | TX
void setup() {
// Set PIN 9 to HIGH for getting HC-05 into AT mode
// Check Step 4 of link for instructions
pinMode(9, OUTPUT);
digitalWrite(9, HIGH);
Serial.begin(9600);
Serial.println("Enter AT Commands: ");
BTSerial.begin(38400); // default baud rate for AT mode
}
void loop() {
if (BTSerial.available()){
Serial.write(BTSerial.read());
}
if (Serial.available()){
BTSerial.write(Serial.read());
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment