Skip to content

Instantly share code, notes, and snippets.

@dholstius
Created September 18, 2012 17: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 dholstius/3744438 to your computer and use it in GitHub Desktop.
Save dholstius/3744438 to your computer and use it in GitHub Desktop.
Read from SoftwareSerial
#include <SoftwareSerial.h>
SoftwareSerial mySerial(2, 3); // RX, TX
void setup()
{
Serial.begin(9600);
while (!Serial) {
; // wait for serial port to connect. Needed for Leonardo only
}
Serial.println("Connected to hardware serial");
mySerial.begin(9600);
}
void loop()
{
if (mySerial.available())
Serial.write(mySerial.read());
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment