|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
|
#1
|
|||||
|
|||||
|
Re: not able to read from accelerometer
The example code is supposed to be an infinite loop. It's an example to show you how to read the accelerometer in code. If the front panel controls are showing you correct values, then everything's working fine. You can then use that code as a springboard to write your own code for your robot project. Remember that the examples are just that: examples.
|
|
#2
|
||||
|
||||
|
Re: not able to read from accelerometer
Quote:
in the picture, the problem is that that while loop isn't ending. |
|
#3
|
||||
|
||||
|
Re: not able to read from accelerometer
Update: Not sure what we did, but we're no longer getting stuck in that loop. Unfortunatly, while we're getting data back, that data is consistently zero. Is it reading from the correct register? or do we need to set that ourself?
|
|
#4
|
||||
|
||||
|
Re: not able to read from accelerometer
So does anyone know what you need to change in the example in order for it to work? I checked my ports, and they're all correct, but I'm only getting data of zero...
|
|
#5
|
|||
|
|||
|
Re: not able to read from accelerometer
One thing we found was that the accelerometer example read loop was set to stop if read status showed an error (in the I2C code.) By removing that stop condition we were able to get readings even though there was an occasional read error. Adding a graph indicator allowed us to see the values read over time.
|
|
#6
|
||||
|
||||
|
Re: not able to read from accelerometer
Just to save some time, I've done the latest Utilities update, used both round and flat cable, triple checked my wiring. We are using I2C.
When I have the right digital module (1) selected, I get "0" as the reading. Bypassing the stop from "status" I can read the error. -44095 It is anticipating address 58 but received ... "Sensor did not respond". When selecting the wrong module (2), I just get no errors and "0" as a reading. Any ideas? |
|
#7
|
||||
|
||||
|
Re: not able to read from accelerometer
I had the same problems, and the only thing that worked for me was to use the flat cable and use I2C. I couldn't get SPI to work no matter what (in fact, I can't figure out for the life of me how the SPI VIs are supposed to work, they're arranged in a very strange way). Even the supposedly fixed example didn't work, and I even noticed the problem and tried to fix it before the fix was posted.
Anyway, use a flat cable, and use I2C. Make sure your cable is fixed according to these instructions: http://www.usfirst.org/sites/default...structions.pdf |
|
#8
|
||||
|
||||
|
Re: not able to read from accelerometer
Well I got an accelerometer working, but not the ADXL 345. The electrical head on my team found an ADXL 335 in the drawers, and we just wired that up to the analog and read the voltage.
I'm not sure if this is an option for other teams, but it's working fine for us now. I hope you guys figure out why the 345 isn't working though... |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|