Skip to content

Instantly share code, notes, and snippets.

@valdiney
Created July 19, 2019 14:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save valdiney/8eb8dfa10e1c992200fce9efe4c341a5 to your computer and use it in GitHub Desktop.
Save valdiney/8eb8dfa10e1c992200fce9efe4c341a5 to your computer and use it in GitHub Desktop.
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