Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 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()
Add Comment
Please, Sign In to add comment