Code: Select all
def updateNB():
pressedZ=wiimote[0].nunchuck.buttons.button_down(NunchuckButtons.Z)
diagnostics.watch(pressedZ)
def updateW():
preWX = -filters.deadband(wiimote[0].motionplus.yaw_down/100,0.005)
preWY = filters.deadband(wiimote[0].motionplus.pitch_left/100,0.005)
diagnostics.watch(preWX)
if starting:
system.setThreadTiming(TimingTypes.HighresSystemTimer)
system.threadExecutionInterval = 2
wiimote[0].nunchuck.update += updateNB
wiimote[0].enable(WiimoteCapabilities.MotionPlus)
wiimote[0].enable(WiimoteCapabilities.Extension)
wiimote[0].motionplus.update += updateW
Thanks in advance!