From the series: Arduino Light Meter Project
Dan Seal, MathWorks
The second part of this two-part video series shows how to take an algorithm developed in MATLAB® and program it onto an Arduino® board using Simulink®. Blocks from Simulink Support Package for Arduino Hardware are used to define the inputs and outputs, and a MATLAB function block is used to incorporate the MATLAB logic that was developed earlier. Running the algorithm on the Arduino in external mode, you can interactively tune parameters of the algorithm. Once the algorithm behaves as expected, you can deploy it to the Arduino with a click of a button. With this approach, the Arduino can run standalone without being connected to a computer, which is useful for a wide range of Arduino projects.
Part 1: Develop an Algorithm in MATLAB Explore how you can start building Arduino projects with MATLAB Support Package for Arduino Hardware. Design an algorithm in MATLAB to read your Arduino’s inputs and control its outputs based on the logic you specify.
Part 2: Program the Device from Simulink Take an algorithm developed in MATLAB and program it onto an Arduino board using Simulink. It is possible to apply this approach to a wide range of Arduino projects.