![]() |
ADXL345_I2C Help
Hello everyone! I have been trying to get the ADXL345 accelerometer working. I have it connected to the I2C spare outputs. Here is my code:
Code:
#include "WPILib.h"Accel X: 0.00000 Accel Y: 0.00000 No matter how much the accelerometer is moved around, these values do not change. Does anyone have any ideas as to what I can do to make the accelerometer work? |
Re: ADXL345_I2C Help
Are you getting any errors on the diagnostics tab of the driver station or on the Console?
Are you sure of your wiring? Make sure clk and data are not swapped. |
Re: ADXL345_I2C Help
Quote:
Quote:
|
Re: ADXL345_I2C Help
Quote:
|
Re: ADXL345_I2C Help
Quote:
-Joe |
Re: ADXL345_I2C Help
Quote:
|
Re: ADXL345_I2C Help
Quote:
|
Re: ADXL345_I2C Help
Quote:
Here's the other application I tried which also works on my system: Code:
#include "WPILib.h" |
Re: ADXL345_I2C Help
1 Attachment(s)
http://www.chiefdelphi.com/forums/at...d=129529771 6
Apologies for the poor quality of the image. WindRiver Version: 3.0.1 WPILib Version: rev2242 |
Power
I am definitely a beginner programmer but I thought that a file I read said that the accelerometer would start in power saving mode unless you wrote 0x08 to POWER_CTL (0x2D) and it would be unresponsive unless this was implemented
here's the file link: http://usfirst.org/uploadedFiles/Rob...sor_Manual.pdf sorry if im just imputting random info again I am really new to the coding world |
Re: Power
Quote:
|
Re: ADXL345_I2C Help
Have you tried looking at the lines with a logic analyzer or a scope yet?
|
Re: ADXL345_I2C Help
Quote:
|
Re: ADXL345_I2C Help
We had last years ADXL345, so we wired that up and it works fine. However, we encounter another problem when having the HiTechnic Compass plugged into the NXT I2C port at the same time the accelerometer is plugged into the spare I2C port. They both work and display values when they are plugged in alone, however when they are both plugged in together, neither will update values and display 0.000000. We do not get any errors, they simply do not work. We also checked the compass and accelerometer source code to make sure that the compass and accelerometer had different addresses which they do (Accelerometer is 0x3A, and compass is 0x02). Here is the code with the Compass added.
Code:
#include "WPILib.h" |
Re: ADXL345_I2C Help
Did you ever resolve this issue?
TIA, Mike |
| All times are GMT -5. The time now is 05:17. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi