Created
January 5, 2019 23:36
-
-
Save alexrqs/36699f8cb1928dbbb53b8c0b9ce344cd to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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