Understanding accelerometer data

Neil Jerram neiljerram at googlemail.com
Sun Nov 1 09:27:55 CET 2009


2009/11/1 Nelson Castillo <arhuaco at freaks-unidos.net>:
>
> Here I print a direction vector (ignoring Z).
> It goes from 0 to 100 (instead of 0.0 to 1.0) to avoid floating point.
> It updates rather fast.
>
> http://svn.arhuaco.org/svn/src/openmoko/accelerometers/dir.c
>
> If I only care about this vector I think I'll use a thread to keep
> reading from the accels.

Fine, but have you measured what the CPU cost of that is?

> I tried something (very fast, not polished) in Python but i feel the
> program lags reading the accels.

Does Python's read have any internal buffering (by default)?  In Guile
(which does) that was the cause of the lag that I saw; and when I
added a call to set the buffer size to just sizeof(struct
input_event), the lag disappeared.

Regards,
         Neil



More information about the community mailing list