Skip to content

Instantly share code, notes, and snippets.

@lattice0
Created March 5, 2017 11:50
Show Gist options
  • Save lattice0/0d848c78e6141e0e0f19f4346929f1d7 to your computer and use it in GitHub Desktop.
Save lattice0/0d848c78e6141e0e0f19f4346929f1d7 to your computer and use it in GitHub Desktop.
Echoes what is received in serial
import serial
ser = serial.Serial('/dev/ttyACM0', 9600)
while 1:
serial_line = ser.readline()
print(str(serial_line).replace('\n', ''))
ser.close()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment