Created
November 17, 2016 13:32
-
-
Save jenschr/18fa6cd565b65ad90de62150d57895bc to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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