> are you sure this isn't just the synchronization events?

For me the problem looks like this.

|type| |code|  |-value-|
0006   0000   0000   0000  0000  -> Seperator time 1
0006   0002   0000   0048  0000  -> Value X1
0006   0002   0001   0024  0000  -> Value Y1
0006   0002   0002   0396  0000  -> Value Z1
0006   0000   0000   0000  0000  -> Seperator time 2 (0.2ms higher than time1)
0006   0002   0000   0048  0000  -> Value X2 (the same X1 )
0006   0002   0001   0024  0000  -> Value Y2 (the same Y1 )
0006   0002   0002   0396  0000  -> Value Z2 (the same Z1 )
0006   0000   0000   0000  0000  -> Seperator time 3 (2.5ms higher than time1)
0006   0002   0000   0048  0000  -> Value X3 (new Value)

I modified the python script from
http://wiki.openmoko.org/wiki/Accelerometer_data_retrieval
(see atachment) that it prints the ms. The result is the same.

204.269 -18 90 882                     
204.462 -18 90 882                     
206.635 -18 90 900                     
206.808 -18 90 900                     
209.127 -36 72 918                     
209.318 -36 72 918                     
211.595 -18 90 918                     
211.789 -18 90 918                     
214.056 -18 72 900                     
214.254 -18 72 900    

Anything must have changed in the new Kernel, cause with the old kernel this 
problem doesn't appear.
Is someone else reading out the Accs and does not have this problem?

Greets Michael
#!/usr/bin/python
import struct
from math import sqrt

x = 0
y = 0
z = 0
secondsensorfile = "/dev/input/event2"
#int, int, short, short, int
fmt = 'iihhi'
#open file in binary mode
in_file = open(secondsensorfile,"rb")
event = in_file.read(16)
while event:
        (time1,time2, type, code, value) = \
                struct.unpack(fmt,event)
        time = time2 / 1000.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 time, x, y, z
        event = in_file.read(16)
in_file.close()
_______________________________________________
Openmoko community mailing list
[email protected]
http://lists.openmoko.org/mailman/listinfo/community

Reply via email to