- Implement the in Simulink using digital output blocks
- Create a device driver using the following guide: https://www.mathworks.com/help/supportpkg/arduino/device-driver-blocks.html
- Create the driver using SPI/I2C blocks in Simulink.
- Create a device driver using the library by using the following guide: https://www.mathworks.com/matlabcentral/fileexchange/72541-create-custom-device-driver-block-for-arduino?s_tid=prof_contriblnk