Documentation Center

  • Trial Software
  • Product Updates

Contents

Arduino Digital Output

Set logical value of digital output pin

Library

Simulink Support Package for Arduino® Hardware/Common

Description

Set the logical value of a digital pin on the Arduino hardware:

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

  • Sending 0 to the block input sets the logical value of the digital pin LOW to 0 V.

The block input inherits the data type of the upstream block, and internally converts it to boolean.

During simulations without the hardware, this block does nothing. See Block Produces Zeros or Does Nothing in Simulation

Dialog Box

Pin number

Enter the number of the digital pin.

Do not assign the same pin number to multiple blocks within the model.

If you set the Target hardware parameter to:

  • Arduino Mega 2560, enter a pin number from 0 to 53.

  • Arduino Uno, enter a pin number from 0 to 13.

  • Arduino Nano, enter a pin number from 0 to 13.

  • Arduino Due, enter a pin number from 0 to 53.

    Note:   To change the Target hardware parameter, select Tools > Run on Target Hardware > Options

See Also

|

External Web Sites

Was this topic helpful?