Skip to content

Instantly share code, notes, and snippets.

@darrenmothersele
Created October 8, 2013 14:40
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 darrenmothersele/6885794 to your computer and use it in GitHub Desktop.
Save darrenmothersele/6885794 to your computer and use it in GitHub Desktop.
A simple Arduino sketch that just passed data between the Arduino's hardware serial port and a Bluetooth device connected as a software serial device on pins 10 and 11.
#include <SoftwareSerial.h>
#define BT_TX 10
#define BT_RX 11
SoftwareSerial BluetoothSerial(BT_TX, BT_RX);
void setup(){
Serial.begin(9600);
BluetoothSerial.begin(9600);
}
void loop() {
if (BluetoothSerial.available())
Serial.write(BluetoothSerial.read());
if (Serial.available())
BluetoothSerial.write(Serial.read());
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment