Last active
May 29, 2019 08:50
-
-
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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