![]() |
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. |
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.
|
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! |
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.
|
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 :)
|
Are you using the flat ribbon db37 cable included in this years KoP, or the previous round one?
|
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.
|
It is weird that it doesn't work with the old cable. We had the same problem. It has worked in previous years. It must have to do with the different slot the dio module goes in.
|
Re: Accelerometer Showing All Zeros
Quote:
|
Re: Accelerometer Showing All Zeros
The sensor manual says
Quote:
so how would someone go about doing this? |
Re: Accelerometer Showing All Zeros
Quote:
But the "write" method of the I2C class seems useful. |
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?
|
Re: Accelerometer Showing All Zeros
Quote:
Code:
m_i2c.write(kPowerCtlRegister, kPowerCtl_Measure); |
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);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". |
Re: Accelerometer Showing All Zeros
Quote:
|
Re: Accelerometer Showing All Zeros
Quote:
|
Which physical slot of the cRio is the DIO module in.
By looking at your code it is in either slot 6 of 8 slot cRIO, or slot 4 of 4 slot cRIO. |
Re: Accelerometer Showing All Zeros
Our team is having the same problem. We have the Accelerometer wired up correctly to the I2C slot, and the Digital Module is in cRIO slot 2. The ode should be working but we still get all 0's. I'll post our code below, maybe that may be the issue.
Code:
/*----------------------------------------------------------------------------*/ |
Re: Accelerometer Showing All Zeros
Sorry I didn't respond before, I forgot to check this thread. We're still having problems. The cable we got in the kit was broken, and we tried to fix it but ended up breaking it more. We have a different ribbon cable that was bought last year, but that doesn't seem to fix the issue.
|
Re: Accelerometer Showing All Zeros
Actually, sorry, we got it to work. I replaced the round cable with a ribbon cable and moved the pwm's to the outside set of I2C ports. I think moving it to the outside is what actually fixed it, but I did both. Thanks everyone for your help!
|
Re: Accelerometer Showing All Zeros
Quote:
|
Re: Accelerometer Showing All Zeros
This seems to be a common symptom, and there are probably many different underlying problems. In the case of 3504, the round cable (from prior years' KoP) was the issue. It seems to have signal integrity problems for any digital signals that change very quickly or that may not work properly in the face of noise.
It probably isn't a bad idea to keep the distance this cable has to span reasonably short and follow the suggestion in the instructions on how to rework the ribbon cable and shorten it if you're doing the rework anyway. |
| All times are GMT -5. The time now is 12:19. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi