Guest User

Untitled

a guest
Nov 19th, 2017
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.47 KB | None | 0 0
  1. import os
  2.  
  3. import serial
  4.  
  5. commands = {
  6. 'ON_C': b'0',
  7. 'DOWN_VOLUME_C': b'1',
  8. 'UP_VOLUME_C': b'2',
  9. 'MUTE_C': b'3',
  10. 'DVD_C': b'4',
  11. 'TV_C': b'5',
  12. 'GAME_C': b'6',
  13. 'CD_MP3_C': b'7',
  14. }
  15.  
  16.  
  17. def figure_out_serial():
  18. devs = os.listdir('/dev/')
  19. try:
  20. devs = [file_ for file_ in devs if 'ttyUSB' in file_][0]
  21. except KeyError:
  22. print("USB serial not found")
  23. raise
  24.  
  25.  
  26. def main():
  27. pass
  28.  
  29.  
  30. if __name__ == '__main__':
  31. main()
Add Comment
Please, Sign In to add comment