The firmware guide walks through how to read the position (presumably relative to a spatial arrangement of DW1000 chips all distance-ranging or otherwise self-locating relative to one another, I’m just assuming). Oddly, I just get 4 0s back for x,y,z, and qf, no meaningful data. Perhaps someone has some thoughts on that, although it isn’t my primary question here.
In shell mode, I can run “av” to get back accelerometer values and these seem to actually contain meaningful data, as they indicate the orientation of the device as I rotate it around in the air calling av over and over again.
But I can’t find an API call for the motion sensor. I looked through dwm.h and through the API guide and I can’t find any way to read the accelerometer from C code, as demonstrated for position in the FW guide. The position example from the firmware guide is fairly straightforward (except for the confusion that that it just returns solid 0s), but I can’t find anything for the accelerometer.
Any comment on this?
Is there a way to read registers from another sensor connected to the I2C bus?
I do not see any parameter for the register address in the function ‘dwm_i2c_read(device address, *data, len)’?
> #define LIS2DX_SLAVE_ADDR 0x19 /* I2C slave address */
> #define LIS2DX_WHO_AM_I 0x0F /* Who I am ID */
> #define LIS2DX_WHO_AM_I_VAL 0x33 /* ID value */
0x33 >> 1 = 0x19
so it seems to be a kind of humor…
greetings horst
Dear Yves,
Thanks for your guide. I have tried these code you offered in dwm_simple.c. But I dont obtain correct data. I printf the value stored in array data[0] and data[1]. As I know, for each axis there are 2 bytes data. Hence I combine data0 and data1and regard as acc value for one axis data. However, when my unit keeping still, the output data is unstable. Looks like ramdom value rather than anything requested by “av” command.
Could you please give any idea?
Great thank to you.
Mok