Device Drivers

版本 1.7.0 (1.9 MB) 作者: Giampiero Campa
Developing Simulink Device Driver Blocks: Step-By-Step Guide and Examples
27.3K 次下载
更新时间 2023/10/11

编者注: This file was selected as MATLAB Central Pick of the Week


Developing Simulink® Device Driver Blocks: Step-By-Step Guide and Examples

View simulink-device-drivers on File Exchange

Open in MATLAB Online

This package contains a guide that explains, in a step-by-step fashion, how to develop device driver blocks (blocks that perform target-specific functions when executed on a target platform). Example drivers for:

-) Arduino digital output, -) Arduino digital input, -) Arduino analog output, -) Arduino encoder read,

are included.

While the examples are built using the Arduino® as the hardware platform (specifically relying on the Simulink Support Package for Arduino), the method applies to any other supported target.

In this guide, the first method to develop device drivers is based on the S-Function Builder block. Following chapters also describe different methods based respectively on the Legacy Code tool, the MATLAB function block, and the System Object block. Advantages and disadvantages of each method are discussed in the guide.

Finally, note that for MATLAB 2013b you will need to apply a fix for the S-Function builder to develop blocks with no input. To do so, go to the following page: , scroll down to the bottom, and follow the instructions therein.


Giampiero Campa (2024). Device Drivers (, GitHub. 检索来源 .

MATLAB 版本兼容性
创建方式 R2012b
Windows macOS Linux

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
版本 已发布 发行说明

See release notes for this release on GitHub:

Updated license

Added System Object and Legacy Code Tool approach, examples, and documentation.
Minor modification to documentation (e.g. updated copyrights).
Documented masking S-Function Builder blocks and the MATLAB Function approach.

Also removed the motor shields -related files since updated versions can be found in the "motor shields" file exchange entry.

Included drivers for AF Motor Shield V2, and Embedded MATLAB-based examples.

Fixed small typos, updated copyright, and added troubleshooting section to the guide.

Fixed a few typos and added a troubleshoot page at the end of the guide.

The PDF document was slightly refined.

要查看或报告此来自 GitHub 的附加功能中的问题,请访问其 GitHub 仓库
要查看或报告此来自 GitHub 的附加功能中的问题,请访问其 GitHub 仓库