Main Content

Adapt Add-ons to New matlabshared.addon.LibraryBase Class

If you have been using the arduinoio.LibraryBase class, follow these steps to adapt your add-ons to the new matlabshared.addon.LibraryBase class:

  1. Inherit your custom add-on class from matlabshared.addon.LibraryBase

    classdef MyAddon < matlabshared.addon.LibraryBase
  2. Add the property Pins to your custom add-on class to continue using it, as this is not included in matlabshared.addon.LibraryBase.

    properties(Access = protected)
          Pins
    end
  3. Change the ArduinoLibraryHeaderFiles property to LibraryHeaderFiles.

            LibraryName = 'ExampleLCD/LCDAddon'
            DependentLibraries = {}
            LibraryHeaderFiles = 'LiquidCrystal/LiquidCrystal.h'
            CppHeaderFile = fullfile(arduinoio.FilePath(mfilename('fullpath')),'src','LCD.h')
            CppClassName = 'LCD'

This ensures that the add-on library is up to date and detected by listArduinoLibraries.

See Also