Main Content


Set shared resource property

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



setSharedResourceProperty(arduinoObj, resourceName, propertyName, propertyValue) sets the specified property of all objects of the given resource to a specified value.


collapse all

Set the mode of all SPI devices to 1.

arduinoObj = obj.Parent; 
setSharedResourceProperty(arduinoObj, 'spidev', 'Mode', 1);

Input Arguments

collapse all

Arduino object, specified as an object that is an internal variable called from within classes that derive from matlabshared.addon.LibraryBase.

Name of shared resource, specified as a character vector.

Specify optional comma-separated pairs of propertyName, propertyValue arguments. Name is the argument name and Value is the corresponding value. Name must appear inside single quotes (' '). You can specify several name and value pair arguments in any order as Name1,Value1,...,NameN,ValueN.

Example: setSharedResourceProperty (arduinoObj, 'spidev', 'Mode', 1);

Version History

Introduced in R2015b