주요 콘텐츠

사용자 지정 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 하드웨어 리소스와 핀 다이어그램

추가 정보