This video clip shows how to connect an Arduino Uno and Arduino Mega using the HARDWARE tx and rx communication configuration. The Mega is the master sending commands to the Uno. After the Uno executes the command it will send an acknowledgement back to the Mega via a buzzer tone connected to pin 9 on the Mega. The Mega Serial Monitor will wait for input from the user and depending on the users menu selection, will process each command option.
Key items to note...
First, the Uno and Mega share power so when the Mega is plugged into the pc BOTH boards are powered up. Second, communication between each board does NOT require an end-of-transmission character. The numeric menu option is broken down into high and low bytes and then reassembled after transmission. Third, the Serial Monitor waits for the user to input a menu option before proceeding. Lastly, the receiver (Uno) sends an acknowledgment back by playing a tone using the buzzer connected to the Mega.
Side note...
I was able to connect 2 USB cables, one to the Uno (on COM5) and one to the Mega (on COM10) which allowed me to view the data being sent and being received after transmission.
Golden rule...
Don't forget to reverse the tx and rx wires when connecting to each board!!
You can download the code here...
codebender.cc/...
or here:
www.mediafire.c...
and
www.mediafire.c...
To view more of my videos please search for "Scott Mon" on RU-vid.
17 сен 2024