Sunday, May 5, 2013

Firmware Calibration Mode

After a lot of back and forth with the guy over at oDesk, we are now very close to finish this up. He has added filtering and the calibration mode! He has gone way beyond what I expected as well. Not only is the LEDs indicating in a nice way what is going on, he just now also added the Joystick USB descriptor which will send the filtered and scaled data over the USB as if it was a joystick/gamepad.

 LEDs explained:

Normal operation:
- green led on.
- yellow led blinks on motion detection.
- red led is off if all is fine, otherwise it's on to show some error occurred.

Calibration mode:
- the green led start blinking.
- the red led is off until you start moving and no stable value is found
- when running the red led blinks if there is no stable value
- when moving the red led is always on if a stable signal is detected
- the green led stops blinking if the calibration is done (stable for more than 5sec).

It will time out after 25sec if it doesn't finding a stable value.

He has added so it responds quickly (150ms), and from what I've tested in a joystick test application it really behaves beautifully! It outputs 16 bit values so value range is  −32768 to 32767 and I get around 3000-5000 when sneaking, 14000-16000 when walking, 22000-24000 when walking a little faster, and maximizing at 32767 when running. I love it!

Here are some graphs of data, and one can clearly see that it can handle noise and variations beautifully. What I did was walking, and then stop, and then run.