Main Content

Run Model on Arduino Hardware

You can prepare, configure, and run a model on your Arduino® hardware.

Before starting this procedure:

  • Connect your Arduino hardware to the host computer using a USB cable.

  • Create or open a Simulink® model.

To prepare and run the model:

  1. Use File > Save As to create a working copy of your model. Keep the original model as a backup copy.

  2. In the Simulink model, on the Modeling tab, click Model Settings to open the Configuration Parameters dialog box.

  3. When the Hardware Implementation pane opens, set the Hardware board parameter to the specific Arduino board you are using.

  4. On the Hardware tab of the Simulink model, in the Mode section, select Run on board and then click Build, Deploy & Start.Build, Deploy & Start on Arduino Hardware Boards

    This action automatically downloads and runs your Simulink model on the board.

Note

If you want to use ENUM data in external mode with Arduino boards, use a built-in integer data type such as int8, uint8, int16, uint16, and int32 to derive the ENUM data. For more information, refer to Define Simulink Enumerations.