Vala DataInputStream.read_int32 in accelerometer message
infibit at gmail.com
Sun Oct 11 08:18:20 CEST 2009
On Sun, Oct 11, 2009 at 1:38 AM, MicVM <ssj2micvm at gmail.com> wrote:
> I am trying to build a vala library to access the accelerometers of the
> freerunner. I am using vala just to give it a try but I am experiencing
> strange problems and wanted to ask if some of you can give me some hints.
> When i read from the input interface of an accelerometer i get the
> b 3 d1 4a 42 ea d 0 0 0 0 0 0 0 0 0
> 1b 3 d1 4a 79 f e 0 3 0 1 0 6c 0 0 0
> 1b 3 d1 4a d7 f e 0 3 0 2 0 26 4 0 0
> that looks quite good to me. However, when I try to read the values in the
> message as integers i have a problem when reding the "value" field, i.e.
> last 32 bit signed integer of the message. I get strange values around +300
> instead of +1062 for the Z value as in the last line of the above example.
> Also for X and Y the values are wrong. I read the stream with the following
> code snippet in vala (using GIO libs):
> var data_stream=new DataInputStream(file_stream);
> //Skip time field, 8 bytes
> //Read eventtype
> I think somewhere I am doing a major mistake because the decoding of the
> int32 is a basic functionality that does not work in my case. The funny
> thing is that decoding of uint16 is done correctly such that eventtype and
> code are read correctly. Any help is appreciate :)
> View this message in context:
> Sent from the Openmoko Devel mailing list archive at Nabble.com.
> devel mailing list
> devel at lists.openmoko.org
What is the maximum frequency at which you are able to read the
Are you able to sample the values properly?
Are the reading in X and Y changing smoothly?
Here is a test that I conducted:
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the devel