Skip to content

Instantly share code, notes, and snippets.

@DzikuVx
Created November 24, 2017 12:20
Show Gist options
  • Save DzikuVx/7839042cda936b97be485a837724f39b to your computer and use it in GitHub Desktop.
Save DzikuVx/7839042cda936b97be485a837724f39b to your computer and use it in GitHub Desktop.
include <HardwareSerial.h>
HardwareSerial MySerial(1);
void setup() {
MySerial.begin(9600, SERIAL_8N1, 16, 17);
}
void loop() {
while (MySerial.available() > 0) {
uint8_t byteFromSerial = MySerial.read();
// Do something
}
//Write something like that
MySerial.write(rand(0, 255));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment