Created
March 23, 2014 13:47
-
-
Save alexbonhomme/9723292 to your computer and use it in GitHub Desktop.
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> | |
SoftwareSerial BTSerial(10, 11); // RX | TX | |
void setup() { | |
pinMode(9, OUTPUT); | |
digitalWrite(9, HIGH); | |
Serial.begin(9600); | |
Serial.println("Enter AT commands:"); | |
BTSerial.begin(9600); | |
} | |
void loop() { | |
// Keep reading from HC-06 and send to Arduino Serial Monitor | |
if (BTSerial.available()) { | |
Serial.write(BTSerial.read()); | |
} | |
// Keep reading from Arduino Serial Monitor and send to HC-06 | |
if (Serial.available()) { | |
BTSerial.write(Serial.read()); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment