Ruslan_nig

Les_2_1

May 15th, 2022
1,034
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.25 KB | None | 0 0
  1. #!/usr/bin/env python3
  2. import serial
  3. if __name__ == '__main__':
  4.     ser = serial.Serial('/dev/ttyACM0', 9600, timeout=1)
  5.     ser.flush()
  6. while True:
  7.     if ser.in_waiting > 0:
  8.         line = ser.readline().decode('utf-8').rstrip()
  9.         print(line)
  10.  
Advertisement
Add Comment
Please, Sign In to add comment