メインコンテンツ

カスタム Arduino ライブラリ

Arduino® のカスタム アドオン ライブラリの作成

アドオン ライブラリは、Arduino ハードウェアで実行されるカスタム C++ コードとホストコンピューターで実行される MATLAB® コードの間の通信インターフェイスです。

アドオン ライブラリを使用して、arduino 接続オブジェクトの作成時にライブラリを含めることで、エンドユーザーは MATLAB コマンド ラインから直接 Arduino の追加機能にアクセスできるようになります。アドオン ライブラリの例については、Control Motors Using Adafruit Motor Shield V2を参照してください。

MATLAB Support Package for Arduino Hardware には、クラスのフレームワークが用意されており、Arduino デバイスや接続されたハードウェア シールドで使用するカスタム アドオン ライブラリを作成することができます。このサポート パッケージにはアドオン ライブラリの開発に役立つクラスと関数が用意されており、これは総称して Arduino アドオン ソフトウェア開発キット (SDK) と呼ばれます。

開始する前に、Custom Add-On Library Conceptsを参照してください。

独自のアドオン ライブラリを作成する準備ができたら、Create Custom Arduino Add-On Libraryの手順に従うか、Create a Custom Arduino Add-On Library をご覧ください。

クラス

matlabshared.addon.LibraryBaseAbstract class for deriving Arduino add-on libraries

関数

すべて展開する

sendCommandSend message to Arduino device from MATLAB
listArduinoLibrariesDisplay a list of installed Arduino libraries
validatePinValidate that pin supports specific functionality
getMCUGet microcontroller of Arduino board
getPinAliasGet alias pin number
getTerminalsFromPinsGet terminal numbers from pins
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
getInterruptTerminalsGet terminals with interrupt functionality
configurePinResourceSet resource owner and mode of pin
decrementResourceCountDecrement count of number of instances of resource
incrementResourceCountIncrement current resource count
getResourceCountNumber of instances of a resource
getFreeResourceSlotGet first free slot of resource
setSharedResourcePropertySet shared resource property
getSharedResourcePropertyGet shared resource property
getResourceOwnerGet terminal resource owner

トピック

使い方

Arduino ハードウェアのリソースとピン配置図

追加情報