Main Content

matlabshared.addon.LibraryBase Class

Namespace: matlabshared

Abstract class for deriving Arduino add-on libraries

Add-On Required: This feature requires the MATLAB Support Package for Arduino Hardware add-on.


classdef MyAddonClass < matlabshared.addon.LibraryBase makes MyAddonClass a subclass of the matlabshared.addon.LibraryBase class.

An object with matlabshared.addon.LibraryBase as a parent class is an Arduino® Add-On. The matlabshared.addon.LibraryBase class provides your Arduino Add-On subclass several protected methods to interact with the arduino object, interact with hardware resources, and communicate with C++ code on the Arduino hardware board.


expand all

A unique identifier for an add-on library. The library name string uses the name of the package folder where the library files are located, followed by the name of the library, with a forward slash separating the two strings.

Example: 'ExampleLCD/LCD'

Data Types: char

A list of other Arduino Add-On libraries required by your Add-On library. The library name string uses the same syntax as the LibraryName property.

Example: {'ExampleLCD/LCD','ExampleAddon/HelloWorld'}

Data Types: char

The name of the C++ header file that contains your add-on class code.

Example: 'MyAddon.h'

Data Types: char

The name of the class name in the C++ header file.

Example: 'MyAddon'

Data Types: char


sendCommandSend message to Arduino device from MATLAB
configurePinResourceSet resource owner and mode of pin
decrementResourceCountDecrement count of number of instances of resource
incrementResourceCountIncrement current resource count
getTerminalsFromPinsGet terminal numbers from pins
getResourceCountNumber of instances of a resource
setSharedResourcePropertySet shared resource property
getSharedResourcePropertyGet shared resource property
getResourceOwnerGet terminal resource owner
validatePinValidate that pin supports specific functionality
getPinsFromTerminalsGet pin numbers from terminal
getTerminalModeGet current terminal mode
isTerminalDigitalCheck if terminal can be used as a digital pin
isTerminalAnalogCheck if terminal can be used as an analog pin
getServoTerminalsGet terminals that have servo functionality
getI2CTerminalsGet terminals with I2C functionality
getSPITerminalsGet terminals that have SPI functionality
getPWMTerminalsGet terminals with PWM functionality
getMCUGet microcontroller of Arduino board
getPinAliasGet alias pin number
getInterruptTerminalsGet terminals with interrupt functionality