Skip to content

Instantly share code, notes, and snippets.

@headHUB
Created July 28, 2017 20:07
Show Gist options
  • Save headHUB/017d58be988b9b6fc6609f200f2f03f7 to your computer and use it in GitHub Desktop.
Save headHUB/017d58be988b9b6fc6609f200f2f03f7 to your computer and use it in GitHub Desktop.
import serial
ser = serial.Serial(‘/dev/ttyAMA0’, 9600, timeout=1)
ser.open()
ser.write(“testing”)
try:
while 1:
response = ser.readline()
print response
except KeyboardInterrupt:
ser.close()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment