Contenu principal

Create Custom Arduino Library Package Folder

R2026b

If you used arduinoio.customLibrary.createLibraryTemplate, the required folder structure was generated automatically. This section describes how to create it from scratch.

The custom Arduino® library folder is a MATLAB® package folder. The top-level package folder name must be the name of your custom Arduino library preceded by a + sign.

The package folder must contain two files: MATLAB Custom Arduino Library Class and the C++ Header File file.

Note

Use only ASCII characters in your MATLAB and C++ classes.

Create a folder package to contain all the files for your custom library, and add it to the MATLAB path. For example:

  1. Add a folder named +arduinoioaddons in your working folder.

  2. In +arduinoioaddons, add a +HelloWorldFolder subfolder.

    This folder contains the MATLAB Custom Arduino Library Class file.

  3. In the +HelloWorldFolder subfolder, add a src folder that contains the C++ Header File.

MATLAB Current Folder browser showing the folder structure: Work > +arduinoioaddons > +HelloWorldFolder > src > HelloWorld.h, with HelloWorld.m at the +ExampleAddon level.

See Also

|

Topics