View Full Version : Wii nunchuck connection problem
g.vannan
03-11-2015, 06:52 AM
I connected wii mote and able to make walkthrough in cave but not able to connect nunchuck...:confused:.need suggestion $$$
is any possible way to get acceleration value of wii mote?
Does the following show the nunchuk is connected?
import viz
viz.go()
#Add wiimote extension
wii = viz.add('wiimote.dle')
#Connect to first available wiimote
wiimote = wii.addWiimote()
#Rumble wiimote for 0.5 seconds when nunchuk is connected
def onConnect(e):
if e.extension == wii.EXT_NUNCHUK:
print 'nunchuk connected'
e.object.setRumble(True,0.5)
viz.callback(wii.EXT_CONNECT_EVENT,onConnect)
You can get the acceleration. The wiimote plug-in (http://docs.worldviz.com/vizard/#Nintendo_Wiimote.htm) page documents all the available commands.
g.vannan
03-15-2015, 11:17 PM
Yes ,code is working
How to connect
Nunchuck joystick
Try the following:
import viz
import vizact
viz.go()
wii = viz.add('wiimote.dle')
wiimote = wii.addWiimote()
nunchuk = wiimote.nunchuk
def printNunchukPosition():
print nunchuk.getPosition()
vizact.ontimer(0,printNunchukPosition)
vBulletin® v3.8.7, Copyright ©2000-2024, vBulletin Solutions, Inc.