Skip to content

Instantly share code, notes, and snippets.

@angeloped
Last active May 29, 2019 08:50
Show Gist options
  • Save angeloped/8743c05cef0dd67ede59198ef2ef2be2 to your computer and use it in GitHub Desktop.
Save angeloped/8743c05cef0dd67ede59198ef2ef2be2 to your computer and use it in GitHub Desktop.
A simple low-level I/O serial monitor using Python os.open() on Linux.
import os
try:
device = os.open("/dev/ttyUSB0", os.O_RDWR)
while 1:
print(os.read(device,255))
finally:
os.close(device)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment