Created
October 8, 2013 14:40
-
-
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.
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
#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