Serial Communication Between Two Arduinos
First, let's look at the master. We need to include the required Wire.h library:
Then, in the setup function, we begin the I2C bus using the Wire.begin() function. If no argument is provided in the function, Arduino will start as a master.
Lastly, we send a character x, which is between 0 and 5. We use the following functions to
begin a transmission to the device with the address 9, write the character, and then stop the transmission:

Read about 'serial communication between arduino' on element14.com. I have two arduinos connected serially meaga and uno i have a numbers 0 to 255 in the uno i should be able to read the numbers 0 to 255 from the uno to. Communication should and will always occur between two a Master and a Slave. The advantage of I2C communication is that more than one slave can be connected to a Master. The complete communication takes place through these two wires namely, Serial Clock (SCL) and Serial Data (SDA). Communication between Arduinos – Serial Le Sat 15 March 2014. This pair of sketches does the same as the I2C communication experiment where one Arduino is the Master issuing orders to the Slave Arduino which takes the orders and turns them into action. I2C is an interesting protocol. It's usually used to communicate between components on motherboards in cameras and in any embedded electronic system. Here, we will make an I2C bus using two Arduinos. We will program one master Arduino to command the other slave Arduino to blink its built-in LED once or twice depending on the received value. I am trying to connect two Arduinos together using the TX and RX using the start/stop protocol. I'm fairly new to the Arduino and I don't know if I'm heading in the right direction. I know two bits of code are needed for the two Arduinos one transmitter and one receiver and need to be connected to each other properly.
Learn the Serial communication between two Arduino. How Serial read and write works. Serial Communication between two Arduino UNO Board is given in this article. You can perform this on any two Arduino Board or another serial communicating device. RX receives serial data and TX sends the serial data to other board or device.
Now let's explore the slave Arduino code. We also include the Wire.h library here, but now we start the I2C bus using Wire.begin(9). The number in the argument is the address we want to use for the Arduino. All devices with address 9 will receive the transmission.
Now we need to react somehow when we receive an I2C transmission. The following function appends a trigger function whenever a character is received. Better said, whenever the Arduino receives a character on I2C, it will run the function we tell it to run:
And this is the function. Here, we simply store the value of the received character:
Serial Communication Between Two Arduino Uno
In loop(), we simply interpret that character to blink the built-in LED at different speeds depending on the received character.
