So I'm just running some tests on the functionality of an ADXL345 3-axis accelerometer with an Arduino Due and I'm running the test code posted on the same page (here) as the product details of what I have, I've wired the device just as in the diagram there as well and am using the test code there as well, the code compiles, uploads and seems to be running correctly, but my serial monitor sends scrolling outputs as follows:The acceleration info of x, y, z are:0 0 0Roll:0.00Pitch:0.00The acceleration info of x, y, z are:0 0 0Roll:0.00Pitch:0.00And nothing changes even when I change the orientation of the breakout board. Any ideas. Is this because the wiring diagram is for an Uno not a Due?
Hello StellarJay,The Wire (I2C) pins in UNO and DUE are different. The example that you mentioned only works with UNO that uses pins A4(SDA) and A5(SCL). For Due you have to use pins 20(SDA) and 21(SCL). To make it easier, search in this forum (in the Arduino Due topics) for ADXL345 examples. Good luck!EDIT: It is weird that your link states a Power voltage range between 3.3 and 6V for the ADXL345. According to the manufacturer, the voltage range is between 2.0 to 3.6V, thus, be careful with that. Remember also that Arduino Due is not tolerant to 5V in the I/O.-p-p
Please enter a valid email to subscribe
We need to confirm your email address.
To complete the subscription, please click the link in the
email we just sent you.
Thank you for subscribing!
via Egeo 16