Skip to content

Instantly share code, notes, and snippets.

@danny-source
Created May 5, 2016 01:22
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 danny-source/f596bee06fb4a4a15c2396a9fa14f9be to your computer and use it in GitHub Desktop.
Save danny-source/f596bee06fb4a4a15c2396a9fa14f9be to your computer and use it in GitHub Desktop.
Arduino UNO SoftwareSerial 9600 passthrought HardwareSerial
#include <SoftwareSerial.h>
SoftwareSerial mySerial(8, 9); // RX, TX
void setup() {
// Open serial communications and wait for port to open:
Serial.begin(9600);
while (!Serial) {
; // wait for serial port to connect. Needed for native USB port only
}
Serial.println("Start!");
// set the data rate for the SoftwareSerial port
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