I2C Sending and Receiving on one Arduino without delay

Hi everybody!

I have a problem that I can't find an answer for, I'm sorry if it has been asked before but couldn't find a thread on it yet:

I have two arduino unos connected by i2c, one is the slave (motor controller) and one the master. now what I want to do is send commands to the slave and read back sensor data (constantly). problem is I can only do either reading or writing (commenting the code out... then either one works)

first I send my command (which is received successfully), then wait 500ms then try to receive but I never get an answer.

now I assume that higher delay times would help here? that would be bad though since I rely on very up to date data and I even want to read some more sensors over a sensor expansion board...

any ideas? do you need to see the code?

thanks for any help!

do you need to see the code?

You probably won't get much help unless you do. I recommend posting the master and slave sketches.

thanks SurferTim! I figured it out now though, the problem was somewhere else in my code ::) hours of searching for the bug and then it's completely unrelated ... duhh..

ok case closed ;)