Hey
if i look at the Firmeware i find for example this code to get, shift and send the accel data.
if (!inv_get_accel(data)) {
packetize_data(data, 3, 12, 'a', out);
eMPL_send_packet(PACKET_TYPE_DATA, out);and the loop to shift in packetize_data() looks like
for (ii = 0; ii < num_elements; ii++) {
packet[ii*2] = (unsigned char) ((uint16_t)(data[ii] >> (24-q)) % 256);
packet[ii*2+1] = (unsigned char) ((uint16_t)(data[ii] >> (16-q)) % 256);
}so far so good.
that means the the function calculates 24 - 12 and 16 -12 (= 12 and = 4).
(shift 12 and 4 times to the right.)
My Problem is now, that the output of this look like
"0,003 0,003 0,243" so there is more on the x axis wich is ok because of the grafity but the number 0.243 is not correct.
if i substract 14 and not 12 (shift 10 and 2 times to the right) i got a value about 1 for the grafity and that matchs better.
does that mean there is a mistake in the firmware? or what am i doing wrong...
ps.: on the "pc side" i just shift the first 8 to the left and the second 0
pss.: i hope you understood my problem in spite of my bad english...
Re: Re: embedded MotionApps Lite
You may not be shifting by the correct number of bytes in your initial implementation. You can check the logic parser in the python test app that is included with the MotionFit SDK download.