|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools |
Rating:
|
Display Modes |
|
|
|
#1
|
|||
|
|||
|
ADXL345 I2C Accelerometer NOT WORKING
ive been having some trouble coding for the accelerometer and i am very confused as to how i can use the i2c bus to actually read from the accelerometer
it would be very helpful if i could get some some sample code or a basic outline of what i need to do |
|
#2
|
|||
|
|||
|
Re: ADXL345 I2C Accelerometer NOT WORKING
Quote:
-Joe |
|
#3
|
|||
|
|||
|
Re: ADXL345 I2C Accelerometer NOT WORKING
Either we have a borked ADXL345, or the LabVIEW code isn't working. The example code just returns a "sensor not responding" error code. It's wired correctly, with the "correct" address of 0x3A.
|
|
#4
|
|||
|
|||
|
Re: ADXL345 I2C Accelerometer NOT WORKING
Quote:
-Joe |
|
#5
|
|||
|
|||
|
Re: ADXL345 I2C Accelerometer NOT WORKING
We have access to a scope...have any references for us as to what "good traffic" will look like?
|
|
#6
|
|||
|
|||
|
Re: ADXL345 I2C Accelerometer NOT WORKING
Just look at the data sheet for the ADXL345... it should have some waveforms in it.
|
|
#7
|
|||
|
|||
|
Re: ADXL345 I2C Accelerometer NOT WORKING
Yep, see them...will give the scope a try and see what's up.
|
|
#8
|
|||
|
|||
|
Re: ADXL345 I2C Accelerometer NOT WORKING
Well, we ended up getting it to work in SPI mode (we did have to shorten the loop time from 100ms to 10ms). So we'll just live with that unless we run out of DIO ports. Thanks!
|
|
#9
|
|||
|
|||
|
Re: ADXL345 I2C Accelerometer NOT WORKING
I have been trying to hook up my accelerometer and have had similar problems. I am writing in Java and have tried using the ADXL345_I2C class to interface with the accelerometer, but to no end. Every time I try to get the acceleration all I get back is 0, no matter how much I shake it.
I have also tried using I2C directly and still got nothing. I would like to try SPI, but I don't know how I would get the data back in the code, the DigitalInput class only returns boolean values, not doubles. If someone could tell me how to use SPI in Java or what I'm doing wrong with the I2C I would really appreciate it!!! Thanks. |
|
#10
|
|||
|
|||
|
Quote:
Joe |
|
#11
|
|||
|
|||
|
Re: ADXL345 I2C Accelerometer NOT WORKING
(Bump on an old thread and hope someone sees it!)
Hello all, I am having the same problem. We are using Java. Can someone post the wiring diagram from LabView or a screenshot of it? I can not find one though I looked. I did put a scope on the clock and data and they show traffic, but I don't have a protocol analyzer to tell if the traffic is correct. Also can anyone who has it working confirm if we need to put out own pullup resistor on the CS pin to get into i2c mode? It doesn't look like it, but it could just be the cRIO telling the senor to wake up over and over again. The code seems so simple I can't imagine it is the code, but if anyone knows any non-obvious points, that would also be appreciated. Thank you in advance! Bob PS My first CD post! |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|