Advertisement
ButchAnton

Untitled

Dec 2nd, 2016
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.37 KB | None | 0 0
  1. void setup() {
  2. char byteRead[1];
  3.  
  4. Serial.begin(115200);
  5. Serial.setTimeout(100);
  6.  
  7. int numBytes = 0;
  8.  
  9. Serial.println("Please enter a character (100ms timeout)");
  10.  
  11. while (!Serial.available());
  12. numBytes = Serial.readBytes(byteRead, 1);
  13.  
  14. Serial.print("|"); Serial.print(byteRead[0]); Serial.print("| Number of bytes read: "); Serial.print(numBytes);
  15. }
  16.  
  17. void loop() {
  18. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement