Skip to content

Instantly share code, notes, and snippets.

@brazen-paradox
brazen-paradox / read_serial.py
Last active September 1, 2020 03:01 — forked from projectweekend/read_serial.py
Reading from a serial port in Python
import serial
from argparse import ArgumentParser
parser = ArgumentParser(description="UART reader for python enabled devices")
# positional arguments
parser.add_argument("device_location", help='device location through which serial data is communicated. Eg. dev/ttyACM0')
parser.add_argument("baud_rate", help='Baud rate in which serial data is communicated. Eg. 9600')
args = parser.parse_args()