Main Content

GPIO Read

Read logical value of GPIO pin configured as input

Add-On Required: This feature requires the Embedded Coder Support Package for BeagleBone Black Hardware add-on.

  • GPIO Read block

Libraries:
Embedded Coder Support Package for BeagleBone Black Hardware

Description

Use this block to:

  • Create a physical input from a GPIO pin.

  • Read the logical value of the GPIO pin at intervals that are determined by Sample time.

  • Send the logical value to other blocks in the model as a stream of Boolean values.

  • The maximum input voltage of the GPIO pin is 1.8 V.

Caution

You can damage your target hardware by:

  • Shorting a GPIO pin to ground.

  • Shorting a GPIO pin with high voltage to another GPIO pin with low voltage.

  • Connecting a GPIO pin to a voltage source greater than the maximum voltage.

  • Exceeding the maximum current by driving multiple GPIO pins high simultaneously.

Ports

Output

expand all

The block outputs the logical value of a digital pin.

Data Types: Boolean

Parameters

expand all

Select a GPIO pin of the BeagleBone hardware board to read its logical status. Do not use the same GPIO pin in multiple blocks within the Simulink® model. For more information on BeagleBone GPIO pins, click View pin map.

Enter the sample time to reading the logical value of the GPIO pin. Smaller values require the processor to complete the same number of instructions in less time, which can cause task overruns. Enter a value greater than zero.

Version History

Introduced in R2014b