Skip to content

Instantly share code, notes, and snippets.

@toygame
Created February 16, 2018 14:52
Show Gist options
  • Save toygame/2573525f6c5c1a8df0f8cbfe8a79743d to your computer and use it in GitHub Desktop.
Save toygame/2573525f6c5c1a8df0f8cbfe8a79743d to your computer and use it in GitHub Desktop.
/*
* Code for Testing Ardiono Uno + HC-05 Bluetooth
* Created by Thanapon@Arduino2Day.com
*/
#include <SoftwareSerial.h>
SoftwareSerial mySerial(2, 3); // RX, TX
void setup() {
Serial.begin(9600);
while (!Serial) {
;
}
Serial.println("Goodnight moon!");
mySerial.begin(9600);
}
void loop() { // run over and over
if (mySerial.available()) {
Serial.write(mySerial.read());
}
if (Serial.available()) {
mySerial.write(Serial.read());
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment