skizziks_53

Arduino Serial Echo 1.0

Aug 8th, 2020 (edited)
1,128
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.49 KB | None | 0 0
  1. /*
  2.   Serial Echo v 1.0 ------ 8 August 2020
  3.  
  4.   Runs on Uno/Mega/Nano/whatever because only the PC-USB connection is used.
  5.  
  6.   This sketch is for testing what serial data the PC is sending to the Arduino.
  7.  
  8.   This sketch listens for characters on the USB serial line, then returns the char integer (ordinal) value.
  9.  
  10. */
  11.  
  12. byte byteRead;
  13.  
  14. void setup() {
  15.   Serial.begin(9600);
  16. }
  17.  
  18. void loop() {
  19.   if (Serial.available()) {
  20.     byteRead = Serial.read();
  21.     Serial.println(byteRead);
  22.   }
  23. }
Advertisement
Add Comment
Please, Sign In to add comment