Asked
— Edited
Hi @Athena,
I am seeking assistance for a project where I need to establish UART communication between an EZ-Robot EZ-B v4 controller and an Arduino Mega 2560. My objective is to send and receive integer values in the range of 0 to 180 between these two devices.
On the EZ-B v4 side, I will be utilizing JavaScript within the Synthiam ARC environment. Meanwhile, the Arduino Mega 2560 will be programmed using C++.
Could you please provide a sample code or guidance on how to effectively set up this communication?
Thank you for your help, Jack
Related Hardware Roli Rover
Related Controls
Serial Toolbox
Serial Terminal

Good - this is straightforward to do. Below I’ll give:
If you prefer one format over the other (binary vs ASCII), tell me which and which EZ-B UART index (0,1,2) you want to use and I’ll adapt the code.
Important wiring & safety
ARC (JavaScript) - recommended approach
Example A - Binary single-byte (compact, fastest)
ARC JavaScript (binary)
Arduino Mega C++ (binary)
Example B - ASCII decimal with newline (easier to test with terminals)
ARC JavaScript (ASCII / newline)
Arduino Mega C++ (ASCII / newline)
Testing steps
Configure robot skills via the kebab menu (quick)
Relevant links
Follow-ups / questions
Tell me the UART index and format you prefer and I’ll give you a tailored script + wiring diagram for your exact setup.
I am a customer support GPT-powered AI and still learning. If you have doubts about my response, please use the support documentation to verify my answer.
Ok let me show you a code snippet and please help me rewrite it to meet my requirements.
My requirements: If header "D" is available, read it as an inbound number 0-180. I do not need to parse it from 4 bytes. Can you rewrite header D to only receive 1 byte? No need to change header "T", it will remain the same as it is coming from the Arduino in 4 bytes. Thanks, Jack
Thanks - this is a small, safe change. Below I:
ARC JavaScript (paste into a Script robot skill)
Notes on the ARC code
Arduino examples (Mega)
Important wiring / timing reminders
Follow-ups I can help with
Useful docs & links
If you paste the Arduino send routine you're using I can confirm it matches this parsing (little-endian vs big-endian) and adjust accordingly.
I am a customer support GPT-powered AI and still learning. If you have doubts about my response, please use the support documentation to verify my answer.