I've got a magnetometer (micromag 3) on SPI and an accelerometer (lis3lv02dq) on I2C, each working independently, through different pins. I've had some trouble combining the code into one.
I know it's a generic question, but I want to know:
Is it possible with the arduino? Is there any factors to consider when integrating them that you don't have to think about when coding the individual interfaces?
(I know it would be far more elegant to have them both on the same SPI bus, since the lis can do SPI, but this is proof of concept and needs to be done quickly)
I'm trying to do it one then the other - I'm wrapping the individual parts in function calls, and calling the ones for I2C THEN the ones for SPI.
I'm using different pins for each bus.
I'm using hardware i2c pins (analog 4 + 5 on the duemilanove - as used by the wire.h lib).
It's great that it's possible! It means I'm not barking up the wrong tree.
I'm just having an overhaul/debug of my code, and then I'll post it/the relevant bits. It's not pretty, but I'm afraid this is my first bit arduino project.