Skip to content

Instantly share code, notes, and snippets.

@kamiyaowl
Created March 23, 2014 17:19
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 kamiyaowl/9726401 to your computer and use it in GitHub Desktop.
Save kamiyaowl/9726401 to your computer and use it in GitHub Desktop.
UART Debug in Arduino
#include <SoftwareSerial.h>
const int baud = 9600;
const int rx_pin = 2;
const int tx_pin = 3;
SoftwareSerial ss(rx_pin,tx_pin);
void setup() {
Serial.begin(9600);
Serial.println("Arduino Serial Monitor Initialize");
ss.begin(baud);
}
void loop() {
if(ss.available()) Serial.write(ss.read());
if(Serial.available()) ss.write(Serial.read());
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment