Skip to content

Instantly share code, notes, and snippets.

@valdiney
Created Jul 19, 2019
Embed
What would you like to do?
import serial
import time
ser = serial.Serial('/dev/ttyS0', 115200)
def toDecimal(some_string):
decimals = [ord(c) for c in some_string]
return bytes(decimals)
#if not ser.isOpen():
#ser.open()
while True:
t = ser.read()
print(t)
#print ('%x' % ord(t))
#ser.read()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment