Accelerometer issues

Ethan here of #4095, rookie team, w00t.

We are having issues working with the accelerometer. Honestly in regards to connecting it to our system and working with it, we have gotten nowhere. So I’m reaching out to you lovely people in hopes that you can help us connect our accelerometer to the system so that we can test it using cRio (cRIO, cRiO, CrIoo?).

Anyways, thanks in advance if you can help us.

Update: Got it connected to the board.
Can somebody double check this?

PWR -> 5V
(-) -> 0V
Dig. I/O 1 -> CK
Dig. I/O 2 -> DI
Dig. I/O 3 -> DO
Dig. I/O 4 -> CS

6 wires in between.

Not sure how to continue…

If I remember correctly, the kit accelerometer is an analog device. You need to wire it to the cRIOs Analog Sidecar rather than the Digital Sidecar.

The accelerometer that came in the KOP has two digital interfaces, I2C and SPI.
The OP looks to be setup for SPI.

The Gyro is analog

If you are using LabVIEW, have you tried the ADXL345 SPI Accelerometer example program? That’s how we started our testing only we used the I2C interface and example.
Go to Support/Find FRC Examples/Sensors/ADXL345 SPI Accelerometer.

We just need to know how to connect the wires, that’s why this post is in ELECTRICAL.

The LabVIEW example shows how to wire both the sensor and digital sidecar.
Running the example will allow you to verify that everything is functional before attempting to run your own code.

You should open LABVIEW and goto the accelerometer example. They show an example (drawing) how to connect the wires…and a short piece of software to test it.

Our team tested all our sensors using the examples in labview. Depending on what type of sensor you’ll need, you simply test as shown, and the go to the software and copy&paste the portion in your main robot application.

Hope this help :slight_smile:

Shush, Connor, that’s not the only thing we need help with.

Alright well the accelerometer is wired into the SPI, so it should still work with the example program, right?

So far to test we’ve been using the printf statements to check out the values, is that all fine and dandy?

Eventually the gyro will be wired into analog though, yes?

Also we’re using windriver…

Thanks for the help guys.

We used the ADXL345 I2C accelerometer LabVIEW example from this year (2012) and found that the example vi ran for several seconds, and then quit. Further checking was that it threw an error, that the string that the software expected from the device was incorrect.

Anyone else find that the VI only ran for several seconds?