I can't seem to get any data from the motion sensors when reading them via Arduino. I visited this page but the link is broken: http://www.udoo.org/docs-neo/Arduin...e_9-axis_motion_sensors_from_the_M4_Core.html I initially (successfully) tested the sensors by checking the UDOO web dashboard and checked via console using: echo 1 > /sensors/accelerometer/enable cat /sensors/accelerometer/data I then removed I2C bus 4 from external pins using the Device Tree Editor (as shown here: http://imgur.com/jHJ4axu). This resulted in UDOO's web dashboard NOT showing motion sensor data, and the /sensors/accelerometer directory disappearing. I cloned https://github.com/UDOOboard/udooneo-arduino-libraries-release to ~/Arduino/libraries. I uploaded the following simple sketch via the dashboard Arduino IDE: #include <Wire.h> #include <FXOS8700CQ_neo.h> FXOS8700CQ accMagSensor = FXOS8700CQ(0x1E); void setup() { pinMode(13, OUTPUT) Serial.begin(115200); Wire1.begin(); accMagSensor.init();} void loop() { accMagSensor.readMagData(); Serial.print((int)accMagSensor.accelData.x); Serial.print(", "); digitalWrite(13, HIGH); delay(100); digitalWrite(13, LOW); delay(100);} The LED on the board blinks as expected, however when reading from serial using an onboard Linux Python script (also at 115200 baud) I just get comma separated zeroes: 0, 0, 0, 0, ... Am I missing a step somewhere? Using UDOO Neo Full.
The correct link is http://www.udoo.org/docs-neo/Arduino_M4_Processor/Controlling_9-axis_motion_sensors.html Just a quick update on the instructions: If you do sudo apt-get update sudo apt-get upgrade Then you will get the latest arduino sketch and library update. You can open the examples from the Arduino IDE on the Neo by menu Open - Examples - (UDOO NEO and something). I have no Neo close by.
Thanks, I managed to get some numbers out although stability seems patchy. Which is the best library for the Neo Full? FXOS8700CQ_neo from GitHub? FXOS8700CQ_neo from apt-get? FXOS8700CQ?
accMagSensor.readMagData(); doesn't read accelerometer data, so it's not surprising to get zeros after that. You should use accMagSensor.readAccelData();