Log in

View Full Version : New digital accelerometer wiring/LabView programming


TD912
19-01-2010, 22:30
Hello CD,
I'm attempting to wire up the new accelerometer that came in the 2010 KoP, as I somehow managed to fry the one from 2009 >_>

I've already seen the manual page here:
http://www.usfirst.org/uploadedFiles/Community/FRC/Game_and_Season__Info/2010_Assets/2010%20Sensor%20Manual%20RevA.doc

I'm jut asking a few questions here just to help make sure I don't fry the new one as well!

So it seems there are two ways to wire the accelerometer to the DigiSidecar, one using I2C or SPI. SPI uses up 4 I/O slots where I2C has it's own area behind the phone-plug-like NXT connector. I'm guessting the resulting output fm the accelerometer will be the same in either case. Are there any advantages to using one method over the other?

Also, how would you properly go about reading the output from the accelerometer in LabView? The old analog accelerometer was pretty simple to work with, but I'm not totally sure how to access the I2C or SPI inputs...

Edit: I searched before I posted this, but i must have missed this thread. It partly answers my question:
http://www.chiefdelphi.com/forums/showthread.php?t=80419

But that still leaves the question of which protocol/port is better to use.

And a bit off-topic, but would there be any reason why the gyro is outputting really insane data, as I'm obviously not rotating at 2000 degrees per second... Or did I damage or program the gyro wrong too?

Alan Anderson
19-01-2010, 23:22
And a bit off-topic, but would there be any reason why the gyro is outputting really insane data, as I'm obviously not rotating at 2000 degrees per second... Or did I damage or program the gyro wrong too?

You might be trying to read the temperature output instead of the rate output.

jhersh
20-01-2010, 01:50
So it seems there are two ways to wire the accelerometer to the DigiSidecar, one using I2C or SPI. SPI uses up 4 I/O slots where I2C has it's own area behind the phone-plug-like NXT connector. I'm guessting the resulting output fm the accelerometer will be the same in either case. Are there any advantages to using one method over the other?

I2C requires fewer wires and is supported in all 3 languages. SPI may be somewhat faster. I prefer I2C.

Also, how would you properly go about reading the output from the accelerometer in LabView? The old analog accelerometer was pretty simple to work with, but I'm not totally sure how to access the I2C or SPI inputs...

You should look at the examples in the LabVIEW Getting Started Window >> Examples. Look for ADXL345.