Created
March 23, 2014 17:19
-
-
Save kamiyaowl/9726401 to your computer and use it in GitHub Desktop.
UART Debug in Arduino
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> | |
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