Use readDigitalPin 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
readDigitalPin in the MATLAB Function
block.