Yeah, that is a little strange. That output looks almost normal for the LSM303D, except I would expect the magnitude of the acceleration vector to be closer to 1 g. The code you attached also seems strange; I took a quick look and though I did not determine what could be the source if the issue, it looks like within that single file there are two different versions of your program, one of which is incomplete. If this is not what you are actually using, can you post the script you are using?
Also, if you have access to an Arduino, you might consider running the Serial example of our LSM303 library. If the values obtained in that way make sense, the issue is likely with your code.
Thank you for the fast reply. I’m sorry that i don’t have any access on Adruino.
Can you explain more on this, I don’t quite get it.
For the program i used, i have been using Ubuntu to code on BeagleBone Black. The library i use is BlackLib. Once again, thanks for the kind respond. =)
We do not see anything obviously wrong with your code. If you need your accelerometer data to be more accurate, you should try getting readings with the sensor in different orientations to see if an offset or scaling needs to be applied.