Hi! I have been building an Arduino robot. I'm going to add my Raspberry Pi to it and it will run a simple OpenCV computer vision program to spot a ball in a camera feed. I have the program written but I hit a bit of a snag. My Arduino obviously controls the motors, as well as a Bluetooth module and an Ultra Sonic Range Finder module. My Raspberry Pi just needs to communicate to the Arduino where the ball is in the camera frame and I will code a simple logic for the robot to move toward it. The bluetooth module uses I2C and I figured I'd stick the Raspberry Pi onto the I2C bus as well and just have the Arduino periodically request information from the Pi. Now, with my soldering done and all, as I like to do things a bit backwards, I shockingly discover that it may not be so easy to run the Pi as an I2C slave!!
Is there a solution for this? Or must I revert to serial communication between the Arduino and the Pi? This might be a problem, since the bluetooth module on my robot uses the hardware serial pins on the Arduino and I have been having problems with the SoftwareSerial library interfering with servos on my robot (I believe the library temporarily prevents interrupts so that they don't interfere with the serial I/O and this messes up the timing for PWM signal to my robot's servos which go haywire).
So is there a way to run the Pi as slave? Any other neat solutions besides serial communication? I guess I could just run the Raspberry Pi as master and the Arduino as slave? If I understand correctly, the master provides the clock on SLC but the slaves can talk to each other as well as to the slave? This might be complicated for the Arduino bluetooth module and range finder module though, as well as for my Adafruit Motor Shield as I believe it uses I2C too.. Their libraries may be written for the Arduino running as master, so I'd have to check how they configure the I2C connection, right?