![]() |
ADXL345 Accelerometer Troubles (examples give errors)
For some reason (being mainly my own stupidity) we never tried to use an accelerometer before kickoff for practice. As it turns out it's a vital part of what we're planning to do (No bonus points if you guess - it's too obvious!), so it certainly doesn't help that nothing I try to do works.
We're using a cRIO-FRC2. We have the digital sidecar connected to the digital module on slot 2, and we connected the ADXL345 accelerometer to the sidecar exactly as shown in the examples. We have tried both examples (I2C and SPI) several times, and neither worked. We've also tried two different accelerometers, both reacting the same. We've checked, double-checked, triple-checked, and then checked a bunch more times - everything is connected correctly. I am completely baffled as to why it's not working. When we run the I2C example, it spits up an error, immediately stopping the VI. I'm afraid I can't copy-paste it at this moment, but generally (from memory): it expected something like "Address 58" (not 100% sure about the number) but instead received "The sensor did not respond" (or something to that effect). The error text then goes on about the error code being undefined, and the rest of that annoyingly long message. Error code was was -44xxx (xxx being your best guess!) I tried to go deeper and see the source of the error. I've found the oddest thing - a devref entering a Read VI was probed error-free, but when probing the input when going inside the read VI, it has the error in it. The SPI example, on the other hand, DOES run, but returns 0 for all axis's at all times. I made sure that earth's gravity was in fact turned on, and even tried moving the sensor myself - it did not output anything. We've given this one less attempts though. I am not a very experienced programmer but I'm skilled enough so you don't have to dumb down your replies for me. :) Side question: Is either protocol better than the other for the accelerometer? For what reason? |
Re: ADXL345 Accelerometer Troubles (examples give errors)
I've had a similar issue to you.
We access the ADXL345 through I2C: Code:
i2c = DigitalModule.getInstance(2).getI2C(slot);[frcrun] [cRIO] Digital module 2 is not present. [frcrun] [cRIO] DIO LoopTiming: 260, expecting: 261 We've updated the cRIO to the 2012 image, and updated the frc netbeans libraries. I was looking through SensorBase, and this javadoc on SensorBase.checkDigitalModule() looked interesting: Module numbers are 1 or 2 (they are no longer real cRIO slots). I'm not sure how to deal with this, and any help would be greatly appreciated. |
Re: ADXL345 Accelerometer Troubles (examples give errors)
Quote:
Quote:
Quote:
|
Re: ADXL345 Accelerometer Troubles (examples give errors)
After spending nearly all day trying different things, I am forced to reach the conclusion that the ADXL345 drivers used in the examples are simply wrong. It doesn't work, nor does it show any signs of working. I've tried with two cRIOs (one 8-slot and one 4-slot), made absolutely sure EVERYTHING is connected as it should. This makes no sense. I give up.
If anyone gets the ADXL345 working using either protocol in LabView, please show me your code. So now I have to go look around for an analog accelerometer... :/ |
Re: ADXL345 Accelerometer Troubles (examples give errors)
Quote:
|
Re: ADXL345 Accelerometer Troubles (examples give errors)
Quote:
I swear I made a forum search before posting this thread. No idea how I missed that one. |
| All times are GMT -5. The time now is 08:10. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi