This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English version of the page.

Note: This page has been translated by MathWorks. Click here to see
To view all translated materials including this page, select Country from the country navigator on the bottom of this page.

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 your model, select Tools > Run on Target Hardware > Prepare to Run. This action changes the model Configuration Parameters.

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

  4. Click the Deploy to Hardware button.

    This action automatically downloads and runs your 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 (Simulink).