[chuck-users] Gyration Air Mouse

Michael Heuer heuermh at gmail.com
Thu May 26 16:53:41 EDT 2011


Les Hall wrote:
> Good day ChucKists!  I have finally purchased what looks to be a good motion controller for my particular needs.  It is the Gyration Air Mouse Elite.  It works great, though my first code attempt at varying a SinOsc produced more zipper than actual sine wave, lol.  I know the zipper cannot be avoided in practice, so I'll work on ways to minimize it and /or make use of it.  Now, to my question:
>
> How do I access all of the axes?  This device has a 2-axis gyro and a 3-axis accelerometer, which IMHO packs a powerful punch missing only the roll gyro.  I can do all sorts of stuff with it, but I need to get at that axis data.  I'm sure it's very simple, how do i do it?

You should be able to follow the ChucK HID examples, then just dump
out all the messages received as you wave the thing about.  Something
like

Hid hid;
HidMsg msg;
0 => int device;
hid.openJoystick(device);

while (true)
{
  hid => now;
  while (hid.recv(msg))
  {
    ... inspect msg


Hopefully that will give you enough to map the messages to the right
parameters.  That is how I did

https://github.com/heuermh/lick/blob/9616ef1ea9b483771700903f7fa57d9ba530a63d/LogitechGamepadF310.ck

though that device doesn't have an accelerometer.

   michael


More information about the chuck-users mailing list