Created
December 14, 2017 12:11
-
-
Save smetronic/bd43195d2303bb5f5b051016dfb2f20d to your computer and use it in GitHub Desktop.
ATMega 328p: Serial Communication
This file contains hidden or 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> | |
SoftwareSerial mySerial(13, 12); // RX, TX | |
void setup() { | |
Serial.begin(38400); //Baud Rate | |
mySerial.begin(38400); | |
} | |
void loop() { | |
if (mySerial.available()) { //Check if serial is available or not | |
Serial.println(mySerial.read()); | |
} | |
if (Serial.available()) { | |
mySerial.println(Serial.read()); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment