Hi,
I´m trying to read this sensor´s output data in a TI environment but it´s giving me some problems. I tried to do exactly like arduino´s library LPS25H.cpp does.
I edited your post to format your code better; you can see the changes by clicking on the pencil icon in the upper right corner of the post.
Can you explain more about your setup and your results? Are you using our LPS25H carrier board? What microcontroller and what I2C library or code are you using? (Where are the i2cTrans object and the I2C_ functions defined?) What value do you see in rxBuf when the values are all the same, and what do you mean by average values?
You should make sure you are using the correct casts to combine the rxBuf bytes. Our library does this:
I´m using a TI-RTOS Launchpad 2650 and I´m editing it with code composer studio. The objective is to read the values from the Altimu v10(gyro,acelom,magnetom and barom). I´ve made all readings correctly except from the barometre´s ones.
The problem is that when I read the values on the rxBuf, those three values always are the same, for example rxBuf[0]=47 rxBuf[1]=47 rxBuf[2]=47.
I get this values debugging it step by step and if I run the programme again those values are identical but with another value.
I just noticed you aren’t setting the most significant bit of the register address. As the datasheet says:
In order to read multiple bytes incrementing the register address, it is necessary to assert
the most significant bit of the sub-address field. In other words, SUB(7) must be equal to 1
while SUB(6-0) represents the address of the first register to be read.
Could you try using 0xA8 instead of 0x28 for the value of txBuf[0] in your read code?