Created
July 19, 2019 14:26
-
-
Save valdiney/8eb8dfa10e1c992200fce9efe4c341a5 to your computer and use it in GitHub Desktop.
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 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