Write data to digital pin on Arduino hardware
Write a value to digital pin 5 with an LED to turn it on.
a = arduino(); writeDigitalPin(a,'D5',1);
a— Arduino hardware connection
Arduino hardware connection
arduino, specified as an object.
pin— Digital pin number
Digital pin number on the hardware, specified as a character vector.
value— Value of the digital data
Value of digital data to write to the specified pin on hardware,
specified as a logical value of
writeDigitalPin in a MATLAB® Function block with the Simulink® Support Package for Arduino Hardware to generate code that can be deployed on Arduino Hardware.
Configure the Arduino peripherals to the appropriate mode using
configurePin before using
writeDigitalPin in the MATLAB Function