From the command line, I have accessed the LIS33DE information by using
i2cget. On the palo35 the device is on I2C bus 3, with address 0x1d.
The X, Y, and Z accelerations are available from registers 0x29, 0x2B,
and 0x2D, respectively. The output from i2cget is an unsigned byte, so
you need to convert it to a signed byte to get the correct acceleration
value. Here is a bash script that displays the X,Y,and Z measurements.
I did a similar thing in C by accessing /dev/i2c-3. I could dig it up
if you are interested.
# EMCZ - 2009/11/14
outX=`i2cget -y 3 0x1d $regOutX b`
outY=`i2cget -y 3 0x1d $regOutY b`
outZ=`i2cget -y 3 0x1d $regOutZ b`
if (($outXg > 127)); then let outXg=$outXg-256; fi
if (($outYg > 127)); then let outYg=$outYg-256; fi
if (($outZg > 127)); then let outZg=$outZg-256; fi
echo "outX: $outX [$outXg milli g]"
echo "outY: $outY [$outYg milli g]"
echo "outZ: $outZ [$outZg milli g]"
On 3/17/2010 12:20 PM, brainfreezy wrote:
> Hey there, has anyone gotten the Palo35's 3D accelerometer to work? After a
> few days, I haven't been able to track down any example code. I can see by
> the schematic that it's hooked up as follows:
> Overo GPIO184_SCL3 to SCL/SPC pin
> Overo GPIO185_SDA3 to SDA/SDI pin
> Overo GPIO146_PWM11 to INT1 pin
> Overo GPIO147_PWM8 to RSVD/INT2 pin
> I need just the basic force vector information, but have used neither the
> Overo Fire GPIO nor the ST LIS33DE accelerometer before and don't quite know
> where to begin. Is there a simple 'Hello World' I could start with to get
> going? This is too cool a feature to pass up!
> Thanks for any advice you might have,