Page 1 of 1

I2c communication between 2 Arduinos

Posted: Sat Jul 10, 2021 6:54 am
by Emadex3
I need some help with with I2c communication between two micro-controllers (Atmega 2560) lets call them "Arduino 1" and " Arduino 2 "

Due to"reasons" Arduino 1 will be programmed with flowcode however , "Arduino 2" has to be programmed using Arduino IDE.

I want to send multiple variables values from "Arduino 1" to "Arduino 2" using I2c (sda/scl pins) <all kind of sensors and outputs connected to arduino 1>

how can I do it ? , any kind soul out there can help me please :mrgreen:

Re: I2c communication between 2 Arduinos

Posted: Wed Jul 14, 2021 10:11 pm
by Benj
Hello,

Which device will be programmed with Flowcode? The master or the slave?

We have some helpful info on I2C available here.
https://www.matrixtsl.com/blog/simplifi ... c-and-spi/

I have created SPI slave devices in the past and use finite state machines to help perform the comms protocol.
https://www.flowcode.co.uk/wiki/index.p ... ateMachine

Re: I2c communication between 2 Arduinos

Posted: Thu Jul 15, 2021 7:10 pm
by Emadex3
Thanks for your attention even though you seem busy :D

The master will be programmed using flowcode .

what I am trying to accomplish is to send a variable's value from one Arduino (Master) to another (slave).

I've seen the examples in the wiki and honestly I don't quite understand the send,recieve procedure, the value being sent is a whole port state while I need to send either individual bits or pull variable values from where ever they are stored and send them while being able to receive each variable value separately


sorry for any inconvenience I've caused and Thanks for your reply. :mrgreen:

here's my poor attempt at i2c communication using 2 Arduino Mega (Both programmed with flowcode, need to know how it works here first :shock: )