Created
December 21, 2015 23:54
-
-
Save aaronpk/dbb3856d660f8b60b3ea 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 | |
ser = serial.Serial('/dev/ttyUSB0', 9600, 8, serial.PARITY_NONE, serial.STOPBITS_ONE) | |
print("turning tv off") | |
ser.write("801s!000\x0D") | |
print("reading reply") | |
response = ser.read(4) | |
print("%s" % response) |
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 | |
ser = serial.Serial('/dev/ttyUSB0', 9600, 8, serial.PARITY_NONE, serial.STOPBITS_ONE) | |
print("turning tv on") | |
ser.write("801s!001\x0D") | |
print("reading reply") | |
response = ser.read(4) | |
print("%s" % response) |
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 | |
ser = serial.Serial('/dev/ttyUSB0', 9600, 8, serial.PARITY_NONE, serial.STOPBITS_ONE) | |
print("checking tv status") | |
command = "801gl000\x0D" | |
print("command: %s" % command) | |
ser.write(command) | |
print("reading reply") | |
response = ser.read(1) | |
print("%s" % response) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment