AW: [SHR] latest unstable with problems!

hab keen oh ne baba_melone at
Sun Apr 5 22:16:48 CEST 2009

Im using my own software, so I swear its not a software issue^^. Im not getting zeros, though, just very small values, that can have a negative sign, too, but do not change.

Von: Michael Tansella <michael-tansella at>
An: List for Openmoko community discussion <community at>
Gesendet: Sonntag, den 5. April 2009, 21:34:08 Uhr
Betreff: Re: [SHR] latest unstable with problems!

> How do they not work? Probably you just use applications that nobody
> cares to update to handle the proper way of reporting accelerometer
> events that was announced about 2 months ago?

I used the python script from the wiki and it delivered only zeros.

import struct
from math import sqrt

x = 0
y = 0
z = 0
secondsensorfile = "/dev/input/event3"
#int, int, short, short, int
fmt = 'iihhi'
#open file in binary mode
in_file = open(secondsensorfile,"rb")
event =
while event:
    (time1,time2, type, code, value) = \
    time = time1 + time2 / 1000000.0

    if type == 2:
        if code == 0:
            x = value
        if code == 1:
            y = value
        if code == 2:
            z = value
    if type == 0 and code == 0:
        sum = int(sqrt(x*x + y*y + z*z))
        print x, y, z, sum
    event =

Openmoko community mailing list
community at

-------------- next part --------------
An HTML attachment was scrubbed...

More information about the community mailing list