How do you utilize the serial ports on the Arduino MEGA through a GUI?

1 view (last 30 days)
I want to control an Arduino Mega 2560 using a MATLAB GUI and through that GUI tell the Mega to control a Nano via UART or I2C. The Nano is used to control various high precision stepper motors. I was never able to control the motors using the Mega alone because trying to get the right amount of steps seemed impossible due to timing constraints caused by slow MATLAB GUI command processing. Anyway, UART (serial) doesn't seem to have a library for the Arduino and I2C isn't working either. Does anyone know how to access the serial ports on the Mega through the GUI or how to get the I2C to work? I'm sure there is a user created serial library somewhere but haven't been able to find one. I'm probably looking in the wrong places.
General Structure:
Set steps and desired motor in GUI
Send step count and motor select data to a hardcoded Nano via serial or I2C
Nano executes the step count on desired motor

Answers (0)

Categories

Find more on Arduino Hardware in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!