|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
|
#1
|
|||
|
|||
|
Accelerometer Showing All Zeros
I'm trying to get the accelerometer to work using Java, but I'm having some trouble. I'm wiring it with I2C and using the "ADXL345_I2C" class. When I try to print out the x, y, and z values using "getAcceleration()", it just prints out zeros for everything.
I've gone over the wiring a bunch of times and it all looks correct to me. We also checked to voltage on the pins and it seems to change when we shake the accelerometer, so I don't think it's broken. Our java and crio are both up to date (as of today). I've never used I2C before, so there might be something obvious I'm missing. Any help would be appreciated. |
|
#2
|
|||
|
|||
|
Re: Accelerometer Showing All Zeros
We seem to be having the same problem. We will continue to research it, if we resolve it we will report back.
|
|
#3
|
|||
|
|||
|
Re: Accelerometer Showing All Zeros
Did you wire it correctly? We had the saem problem with our gyro, but it turned out it the pwm was not supposed to be in the digi-sidecar.
Good luck! |
|
#4
|
||||
|
||||
|
Re: Accelerometer Showing All Zeros
You have the wires going to the special pins on the digital sidecar? There are two sets of four, and you want the set closer to the edge.
|
|
#5
|
|||
|
|||
|
Re: Accelerometer Showing All Zeros
I know it doesn't add much, but our team had this same problem last year. We followed the diagram as best we could, and even asked on CD. I guess we can look forward to having the same problem this year, too
![]() |
|
#6
|
|||
|
|||
|
Are you using the flat ribbon db37 cable included in this years KoP, or the previous round one?
|
|
#7
|
|||
|
|||
|
Re: Accelerometer Showing All Zeros
As promised, we resolved it by following ggorsuch's recommendation. Apparently the older round cable doesn't work for this purpose. Also, be sure to follow the directions here to make sure your flat cable is "built" correctly. Again, thanks ggorsuch for your help on this issue.
|
|
#8
|
|||
|
|||
|
Re: Accelerometer Showing All Zeros
Quote:
|
|
#9
|
|||
|
|||
|
Re: Accelerometer Showing All Zeros
The sensor manual says
Quote:
so how would someone go about doing this? |
|
#10
|
|||
|
|||
|
Re: Accelerometer Showing All Zeros
Quote:
But the "write" method of the I2C class seems useful. Last edited by nickpeq : 21-01-2012 at 00:05. Reason: better method |
|
#11
|
|||
|
|||
|
Re: Accelerometer Showing All Zeros
Does the built-in ADXL345_I2C class do this automatically when the constructor is called, or do we have to do something else, like use the I2C class?
|
|
#12
|
||||
|
||||
|
Re: Accelerometer Showing All Zeros
Quote:
Code:
m_i2c.write(kPowerCtlRegister, kPowerCtl_Measure); |
|
#13
|
|||
|
|||
|
Re: Accelerometer Showing All Zeros
this is what we are using for the code:
Code:
ADXL345_I2C acll= new ADXL345_I2C(2,ADXL345_I2C.DataFormat_Range.k8G);
public void teleopPeriodic()
{
hi1 = acll.getAcceleration(ADXL345_I2C.Axes.kX);
hi2 = acll.getAcceleration(ADXL345_I2C.Axes.kY);
hi3 = acll.getAcceleration(ADXL345_I2C.Axes.kZ);
disp(1, "" + hi1 + " ");
disp(2, "" + hi2 + " ");
disp(3, "" + hi3 + " ");
}
but this gives us just all 0 We also have the accelerometers plugged into the the 2 sets of 4 pins next to the "phone jack". Last edited by sand500 : 21-01-2012 at 16:22. |
|
#14
|
|||
|
|||
|
Re: Accelerometer Showing All Zeros
Quote:
|
|
#15
|
|||
|
|||
|
Re: Accelerometer Showing All Zeros
no just one, we tried both sets of 4 pins and both showed 0.
|
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|