This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English version of the page.

Note: This page has been translated by MathWorks. Click here to see
To view all translated materials including this page, select Country from the country navigator on the bottom of this page.

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.