Skip to content

Instantly share code, notes, and snippets.

@ynx0
Last active July 11, 2019 21:44
Show Gist options
  • Save ynx0/42ff22b6f823751f49a3ad96e4bfa506 to your computer and use it in GitHub Desktop.
Save ynx0/42ff22b6f823751f49a3ad96e4bfa506 to your computer and use it in GitHub Desktop.
Renaming an HC-06 Bluetooth module + (Password/PIN setup)
// from https://www.youtube.com/watch?v=jKWTVXj8JKo
// ref https://mcuoneclipse.com/2013/06/19/using-the-hc-06-bluetooth-module/
// if this doesn't work, we may have to do it manually,
// i.e. we have to follow this guide https://www.instructables.com/id/AT-command-mode-of-HC-05-Bluetooth-module/
// (don't worry it has 06 as well)
void setup() {
Serial.begin(9600);
delay(5000);
setBluetoothName("Test1");
setBluetoothPIN("0000");
delay(2000);
}
void setBluetoothName(String name) {
Serial.print("AT+NAME" + name.c_str());
}
void setBluetoothPIN(String pin) {
Serial.print("AT+PIN" + pin);
}
void loop() {}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment