NeatNit
10-01-2012, 20:39
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?
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?