My Opera is closing 3rd of March

Monkey Beef

Things I do when I'm bored.

Hacking the Wiimote

, ,

I spent my free time today messing around with bluetooth, specifically trying to access my Wii controller from my PC. While it took me a while to get things going, I was finally able to connect through Windows Vista with the dongle from my new Rocketfish Keyboard. And man is it amazing! Using a program called GlovePie I easily mapped the wiimote's buttons to keyboard and mouse movements on my PC. The result being my own makeshift wiimote mouse driver. It's not the most sensitive, since I don't have a sensor bar at my computer, but it (sort of) works.

Here's how I did it in GlovePie:
/* C R A P M O U S E
  --beefmunk's IR-less Wii Mouse--
  Roll the wiimote left or right to move horizontally,
  tilt the wiimote up or down to move vertically.
  Use up and down on the d-pad to page up and down, and
  press a to left-click. */
//Horizontal Sensetivity.  Mess with this until it feels right
var.horSense = 45
//Vertical Sensitivity.  Mess with this until it feels right
var.verSense = 20
//How fast the mouse pointer moves accross the screen
var.speed = 15
//Button Mappings
key.PageUp = wiimote.Up
key.PageDown = wiimote.Down
mouse.LeftButton = wiimote.A
//Test for movement
if wiimote.Pitch > var.verSense then
   mouse.CursorPosY = mouse.CursorPosY - var.speed
elseif wiimote.pitch < -var.verSense then
   mouse.CursorPosY = mouse.CursorPosY + var.speed
endif
if wiimote.Roll < -var.horSense then
   mouse.CursorPosX = mouse.CursorPosX - var.speed
elseif wiimote.Roll > var.horSense then
   mouse.CursorPosX = mouse.CursorPosX + var.speed
endif

Cat HatSumming Me Up

Comments

dennis72 Monday, March 10, 2008 8:18:33 PM

How How How did you get it to work with the dongle? I've been trying for ages!

Write a comment

New comments have been disabled for this post.

February 2014
M T W T F S S
January 2014March 2014
1 2
3 4 5 6 7 8 9
10 11 12 13 14 15 16
17 18 19 20 21 22 23
24 25 26 27 28