カスタム Arduino ライブラリを使用した追加の周辺装置のサポート
R2026bカスタム 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 ライブラリ フレームワークと呼ばれます。
次のいずれかのワークフローを使用して、カスタム ライブラリを作成できます。
カスタム Arduino ライブラリ パッケージ フォルダー、MATLAB クラス、および C++ ヘッダー ファイルを作成および構成します。Create Custom Arduino Libraryの手順に従うか、カスタム Arduino ライブラリの手動での作成をご覧ください。
関数
arduinoio.customLibrary.createLibraryTemplateを使用して、必要なフォルダー構造、MATLAB クラス、および C++ ヘッダー ファイルを含むスターター カスタム Arduino ライブラリを生成します。その後、生成されたテンプレートを変更して、カスタム機能を実装できます。
開始する前に、Custom Arduino Library Conceptsを参照してください。
クラス
matlabshared.addon.LibraryBase | Abstract class for deriving custom Arduino libraries |
関数
トピック
使い方
- Custom Arduino Library Concepts
Understand the components and communication workflow of a custom Arduino library. - Create Custom Arduino Library
Access unsupported hardware and peripherals connected to Arduino boards by creating custom Arduino libraries that enable communication between MATLAB and Arduino hardware.
- Create Custom Arduino Library Using Template
Use thearduinoio.customLibrary.createLibraryTemplatefunction to generate template files for a custom Arduino library. - Adapt Add-ons to New matlabshared.addon.LibraryBase Class
Learn how to configure your existing add-on class to the new matlabshared.addon.LibraryBase class.
Arduino ハードウェアのリソースとピン配置図
- Custom Arduino Library Resources
Manage hardware resources among custom Arduino libraries. - Physical Terminals and Pin Numbers
Understand the difference between terminal numbers and pin numbers on your Arduino board.
追加情報
- Send Data from Arduino to MATLAB Using Custom Library
Create your first custom Arduino library. - Enable Support for LCD Using Custom Arduino Library
Create a custom Arduino library for LCD support.