Main Content

Read and Write Data

Read and write directly to Arduino®hardware

Create an Arduino object usingarduinobefore you use read and write functions. SeeConnect to Arduino Hardwarefor more information.

Note

All functions, exceptplayTone, can be used to generate code using the MATLAB Function block. For more details, seeDeploy Arduino Functions to Arduino Hardware Using MATLAB Function Block.

Functions

configurePin SetArduinopin mode
readDigitalPin Read data from digital pin onArduinohardware
writeDigitalPin Write data to digital pin onArduinohardware
writePWMVoltage Generate PWM signal with specified voltage on digital pin
writePWMDutyCycle Generate PWM signal with specified duty cycle on digital pin
playTone Play tone on piezo speaker using digital pin
readVoltage Read voltage from analog pin onArduinohardware