Connecting 2 Arduinos

How to connect multiple arduinos using the serial Tx/Rx pins
Load the following sketches on each board

Sender

Receiver

Connect Tx from sender to Rx of receiver. And GND to GND

The Sender board will generate a random number from 1-10 and transmit it on the serial pin. The Receiver will read the serial pin and blink the led according to the random number. The Receiver will continue to read until next random number is received and the received byte value is not -1.
Try the sketch on Tinkercad.com

Leave a Comment

Your email address will not be published. Required fields are marked *