Topic: LIS331 Acceleromerter
(Read 965 times)
Aug 30, 2012, 05:04 pm
Hallo, I´m searching a example code for the
but I can not finde one which is over i2c and for arduino not for any other programm language, do anybody have an example code?
Re: LIS331 Acceleromerter
Aug 30, 2012, 06:39 pm
You might be able to knock something together yourself! The Arduino environment has an SPI and I2C library you can use to communicate with the device. Learn how to use this and you're set for life, and can work with pretty much any module communicating over those interfaces.
Read and re-read the datasheet for that module. That'll tell you everything you need to know about which registers to write to (to set up the device) and read from (to get your data). Using plenty of #defines to give the register numbers meaningful and memorable names might make things easier to write.
Even if things don't work first time you stand to learn a lot more than if someone had just given you the code.
By the way... I could be wrong here but there's no reason that example code shouldn't work with Arduino as it is. Providing you happened to have a board set up to run at 8MHz.