Skip to content

Instantly share code, notes, and snippets.

@sfambach
Created March 26, 2023 11:08
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 sfambach/a0204a06367e681cd950386e3680e5f8 to your computer and use it in GitHub Desktop.
Save sfambach/a0204a06367e681cd950386e3680e5f8 to your computer and use it in GitHub Desktop.
Test of HC 06 Bluetooth moudule. Echo server.
/** 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