func, args = self.queue.get_nowait()
except Empty:
break
- print 'do:', func.__name__, args
func(*args)
def pause(self) :
wiiuse.disconnect(self.wiimotes[i])
self.go = False
+ def get_count(self):
+ return self.actual_nmotes
+
+
WT = None
def init(nmotes, timeout, screenResolution=(660, 370)):
for i in range(nmotes) :
wm = Wiimote(i) # access the wiimote object
wm.enable_accels(0) # turn off acceleration reporting
- wm.enable_ir(1, vres = screenResolution, position=wiiuse.IR_BELOW)
+ wm.enable_ir(1, vres = screenResolution, position=wiiuse.IR_ABOVE)
def get_count():
'''How many Wiimotes were found?'''
- return WT.actual_nmotes
+ return WT.get_count()
def quit():
'''Gracefully shutdown the connection and turn off the wiimote leds'''
enable |= wiiuse.ORIENT_THRESH
else:
disable |= wiiuse.ORIENT_THRESH
- print enable, disable
WT.do(wiiuse.set_flags, self.wm, enable, disable)
def set_orient_thresh(self, thresh):