I have 4 gyro sensors that communicate to arduino uno using I2C and then arduino uno sends the data to arduino mega. I was wondering if I could use i2c for this purpose or if I should look for other methods. gyro sensor used in the project: https://www.pololu.com/product/2129/resources

  • Sure, the Mega can be an I2C slave, too. Is there a reason, why you are using a Mega and an Uno, instead of just the Mega? – chrisl Jun 3 '19 at 19:17
  • ok so the arduino uno can be both a slave and a master. thanks yes, I will be adding a bunch of analog sensors to the project later and I don't have enough unused I/O pins on the Mega to connect them to, so I'm using 2 boards. – Soroush Motesharei Jun 3 '19 at 20:57
  • Both master and slave is not adviserable. The I2C protocol has multi master support, but the Wire library does not implement this. If the gyro sensors use I2C and you already considered to use I2C between the Uno and Mega, why don't you connect the gyro sensors to the Mega? They will only use the 2 I2C pins, that you already planned in, since they are all I2C sensors. – chrisl Jun 3 '19 at 21:08
  • thats better thank you! – Soroush Motesharei Jun 4 '19 at 1:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.