Saturday, April 05, 2008

Wii-mote Force-feedback Joystick

What do you get when you combine a Wii-mote, a force-feedback joystick and a few lines of GlovePIE script?


code for part 1:

var.Y = MapRange(wiimote2.Pitch, -90, 90, 1, -1)
var.X = MapRange(wiimote2.Roll, -90, 90, 1, -1)
var.S = 0.8

joystick3.Vibration1 = var.X*var.S
joystick3.Vibration2 = var.Y*var.S
code for part 2:
var.xRot = Wiimote2.RelAccX
var.yRot = Wiimote2.RelAccY

joystick3.Vibration1 = MapRange(var.xRot, -50, 50, -1, 1)
joystick3.Vibration2 = MapRange(var.yRot, -50, 50, -1, 1)


note the joystick/wiimote numbers. your mileage may vary.

No comments: