Hey guys !
I'm having some issues with a little programm I wrote, probably because I'm new to python.
I'll put the code first so it's easier to explain :
What happens is eveything goes fine, and is updated every 0.1 sec until I press triangle.
Code: Select all
#! /usr/bin/env python import sixaxis import pprint import time sixaxis.init("/dev/input/js0") pp = pprint.PrettyPrinter(indent=4) stop = True while(stop = True): state = sixaxis.get_state() if(state['triangle'] == True): stop=False pp.pprint(state) time.sleep(0.1)
At that moment the program freezes, I can see from the last print that triangle is True, and so it never "finishes" and I'm obbliged to do ctrl+z (ctrl+c doesn't work, any ideas why ?)
EDIT : If anyone gets the same problem, it's due to a line missing : sixaxis.shutdown()