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.


Write data to digital pin on Arduino hardware





writeDigitalPin(a,pin,value) writes the specified value to the specified pin on the Arduino® hardware in the connection a.


collapse all

Write a value to digital pin 5 with an LED to turn it on.

a = arduino();

Input Arguments

collapse all

Arduino hardware connection created using arduino, specified as an object.

Digital pin number on the hardware, specified as a character vector.

Value of digital data to write to the specified pin on hardware, specified as a logical value of 0 and 1 or true and false.

Introduced in R2014b