Read and Write Data

Read and write directly to Arduino® hardware

Create an Arduino object using arduino before you use read and write functions. See Connect to Arduino Hardware for more information.


configurePinSet Arduino pin mode
readDigitalPinRead data from digital pin on Arduino hardware
writeDigitalPinWrite data to digital 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


Control LEDs

This example shows how to configure LEDs to turn on and off and to dim and brighten using MATLAB® commands.