# Bidirectional Serial Communication between two Arduinos

**URL:** <https://forum.xod.io/t/bidirectional-serial-communication-between-two-arduinos/4907>\
**Category:** XOD Programming Questions\
**Created:** [February 17, 2021, 10:04pm UTC](https://forum.xod.io/t/bidirectional-serial-communication-between-two-arduinos/4907 "2021-02-17T22:04:50Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![eden-silveira](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.xod.io/eden-silveira/32/2911_2.png) [@eden-silveira](https://forum.xod.io/u/eden-silveira)\
**Post date:** [February 17, 2021, 10:04pm UTC](https://forum.xod.io/t/bidirectional-serial-communication-between-two-arduinos/4907/1 "2021-02-17T22:04:51Z")

</div>

Greetings everyone.  
I have found XOD a week ago searching for a visual programming IDE for microcontrollers, like Arduino.

I am working on a project of a PLC to give a “brain” to some machines.  
So I need to work with two microcontrollers together.  
The first one will have an application for machine control, reading, processing, and writing data (much better XOD than C++ for that), and the second will have its GPIOs connected to field interface electronic circuits (reading and writing data).  
I need to establish serial communication between the Arduinos to do that. We can simulate with LEDs and pots like Mr. Gabbapeople’s example “gabbapeople/uart-led-control”. (Fantastic job).  
Another tutorial was given by Mr. Max Danilin with “[https://medium.com/@gpeople/simple-uart-communication-protocol-in-xod-9ce67cc69d3c](https://medium.com/@gpeople/simple-uart-communication-protocol-in-xod-9ce67cc69d3c)”

I think the solution presented by Mr. Max fits better for my project (packets of data with checksum), but I have a question:

**How to send and receive data for both Arduinos? One to the other.** Like Mr. Gabbapeople’s example have the same configuration, but 1 LED and 1 pot in each Arduino.

I think it can be solved using flow control like Mr. Jan Mallari’s example: “[How to Set Up UART Communication on the Arduino - Circuit Basics](https://www.circuitbasics.com/how-to-set-up-uart-communication-for-arduino/)”.

But how to do this in XOD ?

I appreciate any help

Cheers

---

<div class="post-metadata">

**Author:** ![eden-silveira](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.xod.io/eden-silveira/32/2911_2.png) [@eden-silveira](https://forum.xod.io/u/eden-silveira)\
**Post date:** [February 20, 2021, 6:48pm UTC](https://forum.xod.io/t/bidirectional-serial-communication-between-two-arduinos/4907/2 "2021-02-20T18:48:30Z")

</div>

Hello Everyone

Solved with a simple solution.  
Just added a clock to generate pulses in a regular time to slow down the UART time interval.  
I am using a Mega2560 and a Nano328P for testing. Mega is slower than Nano.

 ![XOD_Uart1](https://canada1.discourse-cdn.com/flex027/uploads/xod/original/2X/4/41ed52bda19148c9e8a3d4d41d97771b96c4c55a.jpeg)

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex027/uploads/xod/original/1X/eb7348baa04192c2ef932d1db54d44f09f8a7888.png) [@system](https://forum.xod.io/u/system)\
**Post date:** [February 22, 2021, 6:49pm UTC](https://forum.xod.io/t/bidirectional-serial-communication-between-two-arduinos/4907/3 "2021-02-22T18:49:02Z")

</div>

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.
