Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <SoftwareSerial.h>
- SoftwareSerial bluetooth(8,9);
- void setup() {
- Serial.begin(115200);
- Serial.setTimeout(50);
- bluetooth.begin(115200); //open BLE connection
- bluetooth.setTimeout(50); //set timeout
- bluetooth.write("AT+ROLE1");
- //bluetooth.write("AT+ROLE0");
- delay(50);
- bluetooth.write("AT+NOTI1");
- delay(50);
- bluetooth.write("AT+CONC40BCB403020");
- delay(50);
- //bluetooth.write("AT+CONNL");
- }
- void loop() {
- while (bluetooth.available() > 0) {
- String response = bluetooth.readString();
- Serial.println(response);
- }
- }
- OK+Set:1
- OK+Set:1
- OK+CONNA
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement