Skip to content

Instantly share code, notes, and snippets.

@jenschr
Created November 17, 2016 13:32
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 jenschr/18fa6cd565b65ad90de62150d57895bc to your computer and use it in GitHub Desktop.
Save jenschr/18fa6cd565b65ad90de62150d57895bc to your computer and use it in GitHub Desktop.
#include <SoftwareSerial.h>
// RX, TX on Arduino
SoftwareSerial mySerial(8, 9);
void setup()
{
Serial.begin(9600);
mySerial.begin(9600);
}
int isInput = 0;
int isOutput = 0;
void loop()
{
/* send everything received from the hardware uart to usb serial & vv */
if (Serial.available() > 0) {
char ch = Serial.read();
mySerial.print(ch);
}
if (mySerial.available() > 0) {
char ch = mySerial.read();
if( ch ){
Serial.print(ch);
}
}
isInput --;
isOutput = 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment