Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * Include headers
- */
- #include <SoftwareSerial.h>
- SoftwareSerial Tunnel(10, 11); // RX, TX
- byte data;
- /**
- * Arduino default setup function, runs only once when the device is turned on
- */
- void setup() {
- Tunnel.begin(9600);
- Serial.begin(9600);
- Serial.println(F("// ---- Tunnel 9600"));
- }
- /**
- * Arduino default loop function, always runs until device turns off
- */
- void loop() {
- if (Tunnel.available() > 0) {
- data = Tunnel.read();
- Serial.write(data);
- }
- if (Serial.available() > 0) {
- data = Serial.read();
- Tunnel.write(data);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement