Advertisement
Guest User

Untitled

a guest
Jul 27th, 2017
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.31 KB | None | 0 0
  1. def main():
  2. init()
  3. stdscr = curses.initscr()
  4. curses.echo()
  5. try:
  6. while True:
  7. c = stdscr.getch()
  8. if c == curses.KEY_LEFT:
  9. forward()
  10. elif c == curses.KEY_RIGHT:
  11. back()
  12. else:
  13. print "not arrow"
  14.  
  15. except KeyboardInterrupt:
  16. gpio.cleanup()
  17. print "Bye"
  18. sys.exit()
  19.  
  20. main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement