Run Model onArduinoHardware
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:
UseFile>Save Asto create a working copy of your model. Keep the original model as a backup copy.
In the Simulink model, on theModelingtab, clickModel Settingsto open the Configuration Parameters dialog box.
When theHardware Implementationpane opens, set theHardware boardparameter to the specific Arduino board you are using.
On theHardwaretab of the Simulink model, in theModesection, select
Run on board
and then clickBuild, Deploy & Start.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 toDefine Simulink Enumerations.