Created
January 28, 2016 08:34
-
-
Save CapacitorSet/a3278ebc778c1e6f4436 to your computer and use it in GitHub Desktop.
This file contains 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 | |
with serial.Serial("COM3", 9600) as ser: | |
while True: | |
s = ser.read() | |
if (s == b'o'): | |
print "Restart" | |
# Alive | |
ser.write(b'n') | |
elif (s == b'm'): | |
print "Ping" | |
# Pong | |
ser.write(b'l') | |
elif (s == b'y'): | |
print "Posizione iniziale" | |
elif (s == b'z'): | |
print "Inizia percorso" | |
else: | |
print s |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment