This actually works really well, much nicer response than my phone and more comfortable grip. It takes a minute or two before the accelerometer and gyros come online so be patient. Here is a modified GlovePIE script … I had some issues with the Smooth Pitch and Smooth Roll and it worked better to remove them.
I am using GlovePIE 0.45 with the separate, “0.46” exe fix. I also installed the toshiba bluetooth stack, although I don’t know if that is a requirement.
[code]
var.host = “localhost”
var.oscPort = 9500
// Set keys to wiimote
var.up = 0
var.down = 0
var.left = 0
var.right = 0
var.a = 0
var.b = 0
var.one = 0
var.two = 0
var.home = 0
var.minus = 0
var.plus = 0
//check if the buttons are a hit
if Wiimote.Up or Wiimote.Classic.Up then
var.up = 1
endif
if Wiimote.Down or Wiimote.Classic.Down then
var.down = 1
endif
if Wiimote.Left or Wiimote.Classic.Left then
var.left = 1
endif
if Wiimote.Right or Wiimote.Classic.Right then
var.right = 1
endif
if Wiimote.A or Wiimote.Classic.a then
var.a = 1
endif
if Wiimote.B or Wiimote.Classic.b then
var.b = 1
endif
if Wiimote.One then
var.one = 1
endif
if Wiimote.Two then
var.two = 1
endif
if Wiimote.Home or Wiimote.Classic.Home then
var.home = 1
endif
if Wiimote.Minus or Wiimote.Classic.Minus then
var.minus = 1
endif
if Wiimote.Plus or Wiimote.Classic.Plus then
var.plus = 1
endif
/*
//again, we can map more variables if we have other Wii expansions
//just use the same format as above.
var.c = Wiimote.Nunchuk.CButton
var.z = Wiimote.Nunchuk.ZButton or Wiimote.Classic.ZL or Wiimote.Classic.ZR
var.x = Wiimote.Classic.x
var.y = Wiimote.Classic.y
var.l = Wiimote.Classic.L
var.r = Wiimote.Classic.R
// Set PPJoy Virtual Joystick to nunchuk joystick (if u ever need it)
PPJoy.Analog0 = Wiimote.Nunchuk.JoyX
PPJoy.Analog1 = Wiimote.Nunchuk.JoyY
*/
// Rumble when shift is pressed
//Wiimote.Rumble = Shift
if Wiimote.Exists then
Wiimote.Led1 = false
Wiimote.Led2 = true
Wiimote.Led3 = false
Wiimote.Led4 = false
endif
/*
// Check expansion
if Wiimote.HasNunchuk then
var.expansion = Wiimote.Nunchuk.JoyX+‘,’+Wiimote.Nunchuk.JoyY+’ NC.Force=‘+Wiimote.Nunchuk.gx+’,‘+Wiimote.Nunchuk.gy+’,'+Wiimote.Nunchuk.gz
else if Wiimote.HasClassic then
var.expansion = ‘CL: ‘+Wiimote.Classic.RawJoy1X+’,’+Wiimote.Classic.RawJoy1Y
else
var.expansion = ‘None’
end if
*/
// Show Wiimote forces on glovepie debug bar, no expansion involve.
debug = ‘Bat=’+Wiimote.Battery+‘; Pitch=’+RemoveUnits(Wiimote.SmoothPitch)+‘; Roll=’+RemoveUnits(Wiimote.SmoothRoll)+‘; RelAcc XYZ=’+Wiimote.RelAccX+‘, ‘+Wiimote.RelAccY+’, ‘+Wiimote.RelAccZ+’; Variables =’+var.up+’ ‘+var.down+’ ‘+var.left+’ ‘+var.right+’ ‘+var.one+’ ‘+var.two+’ ‘+var.home+’ ‘+var.plus+’ ‘+var.minus+’ ‘+var.a+’ '+var.b
//Sendout OSC
SendOsc(var.host, var.oscPort, “Rel-Acc”, float(RemoveUnits(Wiimote.RelAccX)), float(RemoveUnits(Wiimote.RelAccY)), float(RemoveUnits(Wiimote.RelAccZ)))
SendOsc(var.host, var.oscPort, “Pitch”, float(RemoveUnits(Wiimote.Pitch)))
//SendOsc(var.host, var.oscPort, “Smooth Pitch”, float(RemoveUnits(Wiimote.SmoothPitch)))
SendOsc(var.host, var.oscPort, “Roll”, float(RemoveUnits(Wiimote.Roll)))
//SendOsc(var.host, var.oscPort, “Smooth Roll”, float(RemoveUnits(Wiimote.SmoothRoll)))
SendOsc(var.host, var.oscPort, “G”, float(RemoveUnits(Wiimote.g)), float(RemoveUnits(Wiimote.gx)), float(RemoveUnits(Wiimote.gy)), float(RemoveUnits(Wiimote.gz)))
SendOsc(var.host, var.oscPort, “Up”, var.up)
SendOsc(var.host, var.oscPort, “Down”, var.down)
SendOsc(var.host, var.oscPort, “Left”, var.left)
SendOsc(var.host, var.oscPort, “Right”, var.right)
SendOsc(var.host, var.oscPort, “A”, var.a)
SendOsc(var.host, var.oscPort, “B”, var.b)
SendOsc(var.host, var.oscPort, “One”, var.one)
SendOsc(var.host, var.oscPort, “Two”, var.two)
SendOsc(var.host, var.oscPort, “Home”, var.home)
SendOsc(var.host, var.oscPort, “Minus”, var.minus)
SendOsc(var.host, var.oscPort, “Plus”, var.plus)[/code]