According to the docs, the accelerometer on the Udoo Neo has a dynamically selectable acceleration full scale ranges of ±2g / ±4g /±8g. I'd like to be able to adjust the range from ±2g to ±8g. I'm hoping that it is sort of like the "enable" file where all that is needed is to change the value in a file, but I have no idea where to look for that. Does any one have advice on how I could change the scale of the accelerometer?
Did you check the NXP page for clues? http://www.nxp.com/products/sensors...8g-plus-3d-magnetometer:FXOS8700CQ?lang_cd=en
The full documentation for the chip was linked in the Neo Docs. I figured that if I could understand how they got it working at all, I could modify the code for enabling the sensor or reading the data to also allow me to select the scale. Except, I don't know where to look on the Udoo Neo for that code. I feel like the answer is right under my nose, but frankly this is the first time I've spent a lot of time on ubuntu working with an integrated platform like this, so I don't even know where to look for what seems to be a working example. Any help pointing me in the right direction on the Udoo would be appreciated.
I don't have a Neo Full but I suppose you can set it with the I2C commands in http://www.udoo.org/docs-neo/Hardware_&_Accessories/Motion_sensor.html \#!/bin/sh \# set to active mode i2cset -f -y 3 0x1e 0x2a 1 \# enable both accelerometer and magnetometer i2cset -f -y 3 0x1e 0x5b 3 In the datasheet it is written in paragraph 10.6.1 XYZ_DATA_CFG (0x0E) register how to set by writing a value to register 0x0E
So, you seem to be correct. I can read the register and it is set the way I would expect it to, but for some reason the i2cset command doesn't seem to be changing the register. I wrote a script to change it and nothing happens. I tried it in command line, and still, when I read the register it is set to 0x00, when I need it to be 0x02. i2cget works fine, so I really don't know what I'm doing wrong. I feel like I'm missing something really obvious. Edit: I was missing something obvious. You can only write to registers while the chip is in standby. I had to make the initial write to put it in standby, then I could use i2cset to change it to 0x02. After that, it worked. Thanks for the help.
I saw that someone made a python library to control and read the sensors of the Neo so now it should be an easy job! https://www.hackster.io/ubalance-team/magum-sensors-library-222d96