writeDigitalPin

Write data to digital pin on Arduino hardware

Syntax

writeDigitalPin(a,pin,value)

Description

example

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

Examples

collapse all

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

a = arduino();
writeDigitalPin(a,'D5',1);

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