Skip to content
This repository has been archived by the owner on Sep 10, 2022. It is now read-only.

Digital Read

Alan Yorinks edited this page Mar 11, 2019 · 9 revisions

Snap! tab location: Sensing tab.

This reporter block will report the latest digital value for the selected pin. Its value is normally "assigned" to a data block for use and read in a loop. A small delay is sometimes added to the loop to lessen the burden on the CPU. .

If a pin has been configured for sonar operation, the latest sonar value is reported using this block.

The data value may also be tested using a conditional block, e.g. If/Then.

Debugging Values

(These values are reported for Snap! only - data validation for this block is not possible within Scratch)

Debugger Value Explanation
0 No Error
8-1 The pin number specified is not an integer value
8-2 The pin number specified is not a valid analog pin number
8-3 The pin is not configured for digital input operation