Main Content

decrementResourceCount

Decrement count of number of instances of resource

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

Description

count = decrementResourceCount(arduinoObj, resource) decrements current count of instances of the specified resource by one and returns the updated count. Call this function in your add-on Destructor.

example

Examples

collapse all

Decrement the resource count of a servo created with the parent arduino object.

arduinoObj = obj.Parent;			% In the constructor
incrementResourceCount (arduinoObj, 'servo')
1
decrementResourceCount (arduinoObj, 'servo');		% In destructor
0

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 resource to decrement, specified as a character vector. The resource must be added to the arduino object before using incrementResourceCount.

Version History

Introduced in R2015b