Using the Music Shield on the Arduino(atmega328) and I2C

Hi Folks,

I’m working on a project where I would like to use both the music shield and an I2C device on an arduino(atmega328). I have code for the I2c device and verified that it’s working. I’ve also modified the music shield example code and verified that it works, too. But when I put these two together, neither device functions correctly. My only guess is that I’m using the wire library that uses analog pins 4&5 for I2C. I believe these pins belong to PORTC. I also noticed in the example code header file, config.h that defines VS_PORT as PORTC, but looks like only pins 0-3 are explicitly used.

Does anyone know if it’s even possible to use I2C when the music shield is in the mix? If it is possible, how do I go about using it?

Will post code if you want.



You would have to be careful that your i2c code never blocks, as most uses do by default and that will not work well with the music shield. Outside of that it ought to be doable, but I have not checked the pins carefully. You should be able to pool in the same loop that is polling the software serial port for commands off of the ipod connector. Be sure that you are buffering your input to complete your command before acting on it and getting into a blocking state that wedges the player.