How to send 1 byte form arduino (1) to arduino (2)

Hello

I want to do one project with I2C.
Arduino (2) read ADC. When arduino (1) send to arduino (2) a char, arduino(2) send to arduino (1) 1 byte.

The I2C bus doesn't work like that.
There is a Master and one or more Slave(s). The Master controls the bus. The Master can send data to a Slave or request data from a Slave.

Perhaps you can make Arduino (2) with the ADC the Master. It reads the ADC value, and sends it to the Slave. The Slave will be Arduino (1).

Indeed, if you want some communication byte-level between 2 arduinos, you shouldn't go to I2C.

First look at Serial and see if it can't fit your needs (or Software Serial if low bitrate is OK).

Well, thats totally wrong. Check out my Acbus library which I have specifically designed to solve this problem. Unfortunately, it doesn't handle collisions, but I'm working on that.

Acbus.zip (14.9 KB)

prismatics, you made an extra layer over the Wire library so every Arduino is a Master and Slave. The main issue is the collisions. The ATmega datasheet has a section how to detect collisions but that is not implemented in the Arduino Wire library.

The I2C bus is for a single Master with one or more Slave. A Slave can become a temporary Master, but only if the (real) Master knows about it.

I used arduino(1)(master) to connect with smartphone via bluetooth( module hc 05)(uart), i want to set SCL about 1kb. What should I do.

i used 2 sensor but they can't share mass, arduino(1) read adc(1), arduino(2) read adc(2) then send to arduino(1) via opto. But opto too slow to send with SCL 100k (pc817). I want to reduce SCL down about 1kHz