read

Top  Previous  Next

The GPIO pins can be logic level 0 or 1, use read to get the value.

Definition

result, error = raspi.read( pin )

 

Name

Type

Description

pin

number

The pin number

result

nil, 0 or 1

Returns 0 or 1 if success or nil + error on error.

error

nil or string

The error string if applicable.

 

Example

print(raspi.read( 24 ))

Availability

Lua only on Raspberry Pi