Created
November 18, 2017 00:50
-
-
Save brodul/706d29c3ec3f8a2d7da9f1ff91df9fab 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 os | |
import serial | |
commands = { | |
'ON_C': b'0', | |
'DOWN_VOLUME_C': b'1', | |
'UP_VOLUME_C': b'2', | |
'MUTE_C': b'3', | |
'DVD_C': b'4', | |
'TV_C': b'5', | |
'GAME_C': b'6', | |
'CD_MP3_C': b'7', | |
} | |
def figure_out_serial(): | |
devs = os.listdir('/dev/') | |
try: | |
devs = [file_ for file_ in devs if 'ttyUSB' in file_][0] | |
except KeyError: | |
print("USB serial not found") | |
raise | |
def main(): | |
pass | |
if __name__ == '__main__': | |
main() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment