Generate Code and Deploy Model to Hardware
Open the Simulink® editor.
In the Modeling tab, in the Setup section, click Model Settings.
In the Configuration Parameters dialog box, select Hardware Implementation and set Hardware board to Arduino® Mega 2560.
On the Hardware tab of the Simulink model, in the Mode section, select
Run on board
and then click Monitor & Tune to run the model on the Arduino board.Observe the RGB color values picked up from the TCS34725 color sensor in their respective displays.