Two devices on arduino, how?

Hi,

I'd like to use my arduino with an ethernet shield to get temperature and humidity from SHT10 sensor. I guess the problem is, that shield uses SPI bus, and sensor uses I2C. Can this even be done? Would realy like to do that, so if anyone has expirience dealing with that, please help.

Regards, Peter

I guess the problem is, that shield uses SPI bus, and sensor uses I2C

So what's the problem SPI and I2C use different pins.

Oh? Wierd, I connect the SHT10 to pins 12 and 13 (MISO and SCK?) and ethernet shield, that uses pins 2, 11, 12 and 13. So, is there a way to address the devices? (my other thought is, to use a relay to switch between these two, but I'd like a more soft solution...) Is there a way to emulate these on different pins?

Regards, Peter

I guess the problem is, that shield uses SPI bus, and sensor uses I2C.

So this is not the case as the I2C uses pins A4 & A5. It looks like both devices use the SPI bus. So you have three choices:- 1) Rewrite the library for one device (probably the SHT10) to use other pins to produce a bit banged implementation of the SPI bus. 2) Rewrite both libraries to add and extra device enable pin to switch between the two devices. 3) Give up.

After a lot of time spent, I wonder why haven't I thought of rewriting the code. I allways wanted to run two devices parallel :-?

And yes, I just rewrote some code to move sensor's pins. Just have to test it if it still works with ethernet and then I'm almost done, building a weather station with on-line reporting 8-)

Regards, Peter