Arduino Due/Mega

EZB-Arduino-Mega

Arduino Due/Mega

Hardware: Arduino Due/Mega

Author: DJ Sures

This firmware converts a Arduino Due/Mega into an EZB for ARC to connect to it.

This firmware turns an Arduino Mega 2560 into a Synthiam ARC capability controller. Once flashed and connected over USB, ARC can control the Mega just like an EZ-B style board. ARC sends commands over serial, and the Mega exposes hardware features without requiring reprogramming the Arduino code each time.


What you can do with it in ARC

With this firmware, ARC can:

  • Move servos (pan/tilt, arms, animatronics, etc.)
  • Drive PWM outputs (motor speed, LED brightness)
  • Toggle digital I/O (relays, switches, buttons)
  • Read analog inputs (voltage-based sensors)
  • Use 3 extra hardware UARTs for GPS, RFID, motor controllers, etc.
  • Send simple one-way serial using software serial
  • Read HC-SR04 ultrasonic distance sensors

This makes the Mega a cheap and flexible I/O expansion device for robotics and automation.

Firmware Versions

Download
  • Hardened all ring buffers (Serial, Serial1/2/3) with explicit wrap-around and overflow protection.
    • Fixed HC-SR04 handler to return correctly from a void function.
    • Fixed ADC guard logic to use the ADC port count and avoid future out-of-range issues.
    • Replaced generic map() usage for PWM with a faster integer mapping.
    • Added bounds checking for software-serial baud index to avoid out-of-range access.
    • Switched float division in HC-SR04 distance math to integer math for speed and determinism.
    • Added helper macros for port counts for stability when arrays change.
    • Renamed internal helper functions to start with lowercase for consistency.

ARC Pro

Upgrade to ARC Pro

With Synthiam ARC Pro, you're not just programming a robot; you're shaping the future of automation, one innovative idea at a time.