direction

Top  Previous  Next

The GPIO pins can be configured to be input or output.

Definition

result, error = raspi.direction( pin, dirOut )

 

Name

Type

Description

pin

number

The pin number

dirOut

boolean

true to make pin output, false to make pin input.

result

nil or true

Returns true if success or nil + error on error.

error

nil or string

The error string if applicable.

 

Example

print(raspi.direction( 24, true ))

Availability

Lua only on Raspberry Pi