Advertisement
rinaldohack

Untitled

Jul 1st, 2019
707
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. void setup() {
  2.   // initialize both serial ports:
  3.   Serial.begin(115200);
  4.   Serial1.begin(32150);
  5. }
  6.  
  7. void loop() {
  8.   // read from port 1, send to port 0:
  9.   if (Serial1.available()) {
  10.     int inByte = Serial1.read();
  11.     Serial.write(inByte);
  12.   }
  13.  
  14.   // read from port 0, send to port 1:
  15.   if (Serial.available()) {
  16.     int inByte = Serial.read();
  17.     Serial1.write(inByte);
  18.   }
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement