Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
#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