Main Content

Digital Output

Set logical state of digital output pin on Arduino

Add-On Required: This feature requires the Simulink Support Package for Arduino Hardware add-on.

  • Digital Output block

Libraries:
Simulink Support Package for Arduino Hardware / Common

Description

Use the Digital Ouptut block to set the logical state of the specified digital pin on the Arduino® board that you specify in the Pin number parameter.

During the external mode simulation, the block sets the value to the pin that you specify in the Pin number parameter. During simulation in all other modes, the block does nothing.

Ports

Input

expand all

The block sets this value to the digital output pin that you specify in the Pin number parameter.

  • Send 1 to the block to set logical value of the digital pin HIGH to 5 V or 3.3 V, depending on the board voltage.

  • Send 0 to the block to set logical value of the digital pin LOW to 0 V.

Data Types: double

Parameters

expand all

Enter the Arduino board digital output pin number. To open the Arduino pin mapping table, click View pin map. For more information on how to assign pins for the Digital Output block, see Pin Mapping for Arduino Timer-Independent Blocks.

Version History

Introduced in R2012a