주요 콘텐츠

Arduino 핀에서 데이터 읽기 및 쓰기

R2026b
Arduino® 하드웨어에 직접 읽기 및 쓰기

읽기 및 쓰기 함수를 사용하기 전에 arduino를 사용하여 Arduino 객체를 만듭니다. 자세한 내용은 Connect to Arduino Hardware 항목을 참조하십시오.

Arduino 탐색기를 사용하면 Arduino 및 기타 지원되는 하드웨어에서 대화형 방식으로 핀을 구성할 수 있으며, 이를 통해 MATLAB®과 MATLAB Online™에서 데이터를 읽고 쓸 수 있습니다. 자세한 내용은 Configure Read and Write for GPIO Pins Using Arduino Explorer App 항목을 참조하십시오.

설치된 MATLAB 버전에서 지원되는 하드웨어의 전체 목록을 보려면 Supported Hardware 항목을 참조하십시오. MATLAB Online에서 지원되는 보드, 워크플로, 플랫폼에 관한 자세한 내용은 Get Started with MATLAB Online for Arduino 항목을 참조하십시오.

참고

playTone을 제외한 모든 함수는 MATLAB Function 블록을 사용하여 코드를 생성합니다. 자세한 내용은 Deploy Arduino Functions to Arduino Hardware Using MATLAB Function Block 항목을 참조하십시오.

함수

arduinoConnection to the Arduino and Arduino-compatible ESP32 hardware
configurePinSet Arduino pin mode
readDigitalPinRead data from a specified pin on Arduino hardware
writeDigitalPinWrite data to a specified pin on Arduino hardware
writePWMVoltageGenerate PWM signal with specified voltage on digital pin
writePWMDutyCycleGenerate PWM signal with specified duty cycle on digital pin
playTonePlay tone on piezo speaker using digital pin
readVoltageRead voltage from analog pin on Arduino hardware

도움말 항목