Advertisement
Guest User

Untitled

a guest
Jun 30th, 2016
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.42 KB | None | 0 0
  1. #include <SoftwareSerial.h>
  2. byte incomingByte;
  3.  
  4. void setup()
  5. {
  6.   Serial.begin(9600);
  7.   Serial2.begin(4800); // 16 17
  8.  
  9. }
  10.  
  11. void loop() {
  12.  
  13.  if (Serial2.available() > 0) {
  14.                 // read the incoming byte:
  15.                 incomingByte = Serial2.read();
  16.  
  17.                 // say what you got:
  18.                 Serial.print("I received: ");
  19.                 Serial.println(incomingByte); // , DEC
  20.         }
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement