WorldViz User Forum

WorldViz User Forum (https://forum.worldviz.com/index.php)
-   Vizard (https://forum.worldviz.com/forumdisplay.php?f=17)
-   -   Wii nunchuck connection problem (https://forum.worldviz.com/showthread.php?t=5304)

g.vannan 03-11-2015 06:52 AM

Wii nunchuck connection problem
 
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?

Jeff 03-11-2015 07:46 AM

Does the following show the nunchuk is connected?

Code:

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 page documents all the available commands.

g.vannan 03-15-2015 11:17 PM

Yes ,code is working
How to connect
Nunchuck joystick

Jeff 03-16-2015 06:42 AM

Try the following:

Code:

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)



All times are GMT -7. The time now is 10:27 AM.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Copyright 2002-2023 WorldViz LLC