Advertisement
Ruslan_nig

les2_3_py

May 19th, 2022
674
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #!/usr/bin/env python3
  2. import serial
  3. import time
  4. if __name__ == '__main__':
  5.     ser = serial.Serial('/dev/ttyACM0',9600, timeout=1)
  6.     ser.flush()
  7. while True:
  8.     ser.write(b"Hello from Raspberr Pi!\n")
  9.     line = ser.readline().decode('utf-8').rstrip()
  10.     print(line)
  11.     time.sleep(1)
  12.  
  13.  
Advertisement
RAW Paste Data Copied
Advertisement