Skip to content

Instantly share code, notes, and snippets.

@aaronpk
Created December 21, 2015 23:54
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 aaronpk/dbb3856d660f8b60b3ea to your computer and use it in GitHub Desktop.
Save aaronpk/dbb3856d660f8b60b3ea to your computer and use it in GitHub Desktop.
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)
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)
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