Measure of the file /dev/input/event3 (Accelerometer data)
Joel Newkirk
freerunner at newkirk.us
Tue Sep 23 13:47:17 CEST 2008
On Tue, 23 Sep 2008 03:59:00 -0700 (PDT), daniel103
<danifuentes2000 at yahoo.es> wrote:
>
> Hello again,
>
>
> in /dev/input/event3 (or /dev/input/event2) you can see something like
> that:
>
>
> 00030e0 c157 48d7 82df 000c 0000 0000 0000 0000
> 00030f0 c157 48d7 a770 000c 0002 0000 0012 0000
> 0003100 c157 48d7 a7ea 000c 0002 0001 0012 0000
>
> the last two columns are the accelerometer values. my question is ¿what
> is
> the measure of this values? ¿how i can obtain the decimal value?
>
> thanks so much
http://wiki.openmoko.org/wiki/Accelerometer_data_retrieval
Conversion from hex to decimal depends on programming language used. The
Python script embedded near the bottom of the above-linked page is the
basis for my V2 testing after some alteration. (I used 'bc' console calc to
convert hex to dec in the bash-script V1 tests which read sysfs instead of
/dev/input)
As far as the 'measure', lay the phone flat on a table and check the Z-axis
measurement, which is probably somewhere around 53-55 decimal - that's
measuring 9.8 m/s^2, or 32 ft/s^2, or 1G. ;) The default mode for these
guys is about 2G fullscale, though you can set it into a mode where
fullscale is ~8G. (which, I presume, means an accompanying loss of detail)
The counters represent -127 to 128, with FF==-1. (at least in 2G mode,
which is all I've used)
j
More information about the community
mailing list