arthare/wifilapper — pull request #31 by wonder99 (2014-04-26 02:21:48+00:00)
Title: Several bug fixes, and lots of accelerometer enhancements

Bug fixes:
- The enable on the IOIO configuration activity affected the accelerometer enable variable.
- restoring spinner values were not rendered onscreen when the activity was resumed
- SSIDs would sometimes get leading and trailing quotes, causing LapSender socket to fail on connection

Enhancements:
- the accelerometer now can be calibrated (phones don't always read zero when flat).
- the angle of the phone mount relative to the car can be compensated for, so that g-forces are true measures of lateral and longitudinal forces, regardless of the angle of the phone mount
- G-forces are remapped so that X,Y,and Z meanings are preserved, in either Portrait or Landscape modes
- accelerometer readings can now be optionally filtered:
* Averaging: prevents DB updates at rates faster than 14Hz. If multiple sensor changes occur, they get averaged, and submitted at a rate below 14Hz. This also reduces sensor noise.
* Hi-pass: A long-term average force is maintained, and subtracted from each reading. So on a long term, all g-forces will average to zero (gravity is subtracted)
The above two filters can be enabled in any combination, or both disabled.

- IOIO supports up to 20Hz sampling, but only submits to the database if the most recent value is different than the last submitted by more than 5mV.
- IOIO sample rate no longer drifts. So in the long run, the average sample rate equals the requested rate.