Monday, March 5, 2012

Helicopter Auto Pilot - Wiimote Communication (w-d)

Back to Helicopter Auto Pilot - Introduction
Download source code & runtimes: Heli Control






Wiimote communication (w-d)
To connect the wiimote with the desktop (w-d) I use a Bluetooth connection and the program GlovePie from Carl Kenner: https://sites.google.com/site/carlkenner/glovepie
Glove Pie is an easy to use program (I love that it doesn't require installation) that can read the wiimote and send information to other programs. It comes with it's own special scripting language.

Download my script called HeliWii.PIE.

In particular I'm using it to send commands from the wiimote to the laptop program. The first two lines of the script indicate the IP and port to send the information to:

OSC.port = 53525
OSC.ip = "192.168.5.13"

Change them to suit your environment.

Wiimote  controls:
  • Home: Toggle IR transmission on/off
  • B: Go from No Power mode to Manual Power mode. (led 1 on)
  • Nunchuk Pitch: Controls power in Manual Power mode.
  • Nunchuk Joystick: Turn Left/Right, go Forward/Backward.
  • C & Z together (nunchuk) : 
    • First time: Auto Power! Go from Manual Power to Auto Power mode (4 leds on)
    • Second time: Emergency stop! go from Auto Power to No Power mode (leds 1 & 4 on).
  • minus (-)/plus (+): Adjust drift left/right.
  • (1)/(2): Adjust elevation set point up/down when in Auto Power mode.

No comments: