Main Content

Sync Models by Using Arduino Connected I/O Board

This example shows how to synchronize models using an Arduino® Connected I/O board with real time and using Simulink® Desktop Real-Time™ running in Connected IO mode.

The model sends software-generated pulse-width modulation signal to Arduino pin 13 where it can be observed by an oscilloscope or visually by observing the LED connected to pin 13. The duty of the signal can be controlled by the attached knob control.

Open the Model

Open the model sldrtex_arduino. In the MATLAB® Command Window, type:


Run the Model

To run this model, use this setup:

  1. The model is currently configured for Arduino Mega 2560. If necessary, change the configuration to match your Arduino model.

  2. To change to Connected IO mode (required), on the Desktop Real-Time tab, select Mode > Connected IO.

  3. To start real-time execution, click Run in Real-Time.

Note: This model requires Simulink Support Package for Arduino Hardware.