Accelerometer Sensor and I2C Mystery
I have done more testing with the “ACCL-Nx-3g3x” accelerometer part from Mindsensors. My goal was to obtain the X and Y axis values from the sensor over Bluetooth using Lego NXT Direct Commands, and then link those values to pitch and roll gauges on a PC Dashboard.
First, I looked up what Lego NXT Direct Commands were needed to read the sensor's values over I2C. I checked the Mindsensors datasheet to determine what I2C command codes and memory addresses to use. Reading single axis registers worked well, however, when I started polling the sensor at 40ms intervals, NXT was timing out. It appears the NXT uses a software driven I2C, and there were some issues with glitches being introduced. I can confirm this has been fixed in Lego NXT's version 1.04 firmware released a couple of weeks ago. Downloading and installing the new NXT firmware fixed the problem for me, so anyone building home-brew I2C sensors should try the upgrade!
The colors and other properties can be edited, but here are the pitch and roll gauges I ended up with and included in the sample roboDNA Lego NXT dashboard:
First, I looked up what Lego NXT Direct Commands were needed to read the sensor's values over I2C. I checked the Mindsensors datasheet to determine what I2C command codes and memory addresses to use. Reading single axis registers worked well, however, when I started polling the sensor at 40ms intervals, NXT was timing out. It appears the NXT uses a software driven I2C, and there were some issues with glitches being introduced. I can confirm this has been fixed in Lego NXT's version 1.04 firmware released a couple of weeks ago. Downloading and installing the new NXT firmware fixed the problem for me, so anyone building home-brew I2C sensors should try the upgrade!
The colors and other properties can be edited, but here are the pitch and roll gauges I ended up with and included in the sample roboDNA Lego NXT dashboard:

Comments
CAn a gauge tell me feedback on the ultrasonic sensor?
Kurt
which includes additional information and sample code (written in NBC)
Currently (on firmware 1.04) I am still getting occasionally severe bus hangs when reading acceleration data, which is a bit odd.
I've also written some PID control stuff that makes use of the accelerometers. Maybe it would interest you.