Skip to content

Instantly share code, notes, and snippets.

@alexrqs
Created January 5, 2019 23:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alexrqs/36699f8cb1928dbbb53b8c0b9ce344cd to your computer and use it in GitHub Desktop.
Save alexrqs/36699f8cb1928dbbb53b8c0b9ce344cd to your computer and use it in GitHub Desktop.
const int LED = 13;
const int PWR = 12;
char blueName[4] = "lazy";
char pin[5] = "0000";
char blueSpeed = "4";
char mode = "1"; // 0 slave, 1 master
void setup() {
pinMode(LED, OUTPUT);
pinMode(PWR, OUTPUT);
Serial.begin(38400);
digitalWrite(LED, HIGH);
delay(4000);
digitalWrite(LED, LOW);
digitalWrite(PWR, HIGH);
delay(1000);
Serial.print("AT\r\t");
// Serial.print("AT+NAME");
Serial.print("AT+NAME=");
Serial.print(blueName);
Serial.print("\r\t");
Serial.print("AT+PIN="); // AT+PSWD
Serial.print(pin);
Serial.print("\r\t");
Serial.print("AT+MODE=");
Serial.print(mode);
Serial.print("\r\t");
digitalWrite(LED, HIGH);
}
void loop() {
// put your main code here, to run repeatedly:
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment