![]() |
Trouble with the AXDL345_I2C accelerometer.
I apologize in advance for creating another accelerometer thread, but none of the others were able to help me, and I didn't want to hijack l0stboy's, in case we're having different problems.
My problem is the one most people are having: I always read 0.0 on all axis. I have the module connected to the I2C port on the sidecar, yes I2C closest to the NXT connector, not the digital outs next to it. We are using the new flat ribbon cable to talk to the DSC. One of the connectors was flipped, but we fixed it, per the instructions on the KoP site. It has been verified working by using two PWM servos, and two digital encoders. I have verified that the pins are connected one-to-one from the accelerometer to the sidecar. I have tested the cable using an ohm-meter, and have while it is connected measured 5.1V on the "5V" pin, and 4.7V on the "SDA" and "SCL". I do not have easy access to an oscilloscope, but can get one if truly necessary. Looking at the spec sheet for the ADXL345, and the WPILibJ source code, we noticed that the read bit is not set during I2C.read(), so I tried replacing Code:
registerAddressArray[0] = (byte) registerAddress;Code:
registerAddressArray[0] = (byte) (registerAddress | 0x01);Quote:
We have also tried replacing the accelerometer, but it didn't work either. Here is the code I am running to test the accelerometer: Code:
package edu.wpi.first.wpilibj.templates; |
Re: Trouble with the AXDL345_I2C accelerometer.
we had this same problem, when we switched to the flat cable, it worked for a while, but it doesnt work now.
|
Re: Trouble with the AXDL345_I2C accelerometer.
Ours is working (albeit very noisy) with the default code so the library does not need changing.
- do you have your sidecar power connected? - did you average some readings and save a zero G offset (not your problem yet) - are you sure the accelerometer is not plugged in backwards? I'm not a java expert but should accel be a pointer if you are going to instantiate the class with 'new'? HTH |
Re: Trouble with the AXDL345_I2C accelerometer.
Quote:
Quote:
Quote:
Quote:
|
Re: Trouble with the AXDL345_I2C accelerometer.
Quote:
Quote:
Good luck! |
| All times are GMT -5. The time now is 22:21. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi