メインコンテンツ

カスタム Arduino ライブラリを使用した追加の周辺装置のサポート

R2026b
LCD 画面や NeoPixel LED ストリップなどのカスタム周辺装置を統合するためのカスタム Arduino ライブラリを作成する

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

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

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

次のいずれかのワークフローを使用して、カスタム ライブラリを作成できます。

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

クラス

matlabshared.addon.LibraryBaseAbstract class for deriving custom Arduino 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
arduinoio.customLibrary.downloadLibraryInstall Arduino compatible libraries (R2026b 以降)
arduinoio.customLibrary.createLibraryTemplate Create custom library template (R2026b 以降)
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 ハードウェアのリソースとピン配置図

追加情報