<< DCMOTOR_SB Arduino toolbox DIGITAL_WRITE_SB >>

Arduino toolbox >> Arduino toolbox > DIGITAL_READ_SB

DIGITAL_READ_SB

Reads the logical value 0 or 1 from an Arduino GPIO port

Overview

Contents

Palette

Arduino

Description

The Arduino uses a number of GPIO (General Purpose I/O) lines to read or write single bit electronic components.

On an Arduino Uno the logic ports 2 to 13 are available (ports 0 and 1 are used for serial communication). On the Arduino Mega ports 2 to 53 are available. The port takes the value 0 (ground) or 1 (logic high level = 5V on the Arduino Uno or Mega).

The maximum sampling freqency for this block is approximately 125 Hz.

Parameters

The port number to be chosen between 2 and 53, depends on the type of Arduino used.

The card number when several cards are in use. Must be 1 for the moment

Example 1

The example below shows the use of the block in case of a circuit consisting of a push button connected to GPIO 7 and a LED connected to GPIO 10. When the push button is pressed the LED lights up.

See also


Report an issue
<< DCMOTOR_SB Arduino toolbox DIGITAL_WRITE_SB >>