Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <SoftwareSerial.h>
- #define RX 2
- #define TX 3
- #define BAUD 9600
- boolean echoOn = true;
- SoftwareSerial ss (RX, TX);
- void setup() {
- Serial.begin(BAUD);
- ss.begin(BAUD);
- Serial.print("Simple serial device tester.");
- }
- void loop() {
- if (Serial.available()) {
- char ch = Serial.read();
- if (echoOn) {
- Serial.println(ch);
- }
- ss.print(ch);
- }
- if (ss.available()) {
- char ch = ss.read();
- Serial.print(ch);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement