Created
March 26, 2023 11:08
-
-
Save sfambach/a0204a06367e681cd950386e3680e5f8 to your computer and use it in GitHub Desktop.
Test of HC 06 Bluetooth moudule. Echo server.
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
/** modified by SteFam www.fambach.net GPLII*/ | |
#include <SoftwareSerial.h> | |
SoftwareSerial bt(10, 11); // RX | TX | |
void setup() | |
{ | |
Serial.begin(9600); | |
bt.begin(9600); //Default Baud rate | |
Serial.println("Connect to HC-XX with 1234 as key!"); | |
} | |
void loop() | |
{ | |
// Feed any data from bluetooth to Terminal. | |
if (bt.available()) | |
Serial.write(bt.read()); | |
// Feed all data from terminal to bluetooth | |
if (Serial.available()) | |
bt.write(Serial.read()); | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment