- bits = gpio.inputs([group])
- state = gpio.input([group, ]nr)
- bits = gpio.outputs([group])
- state = gpio.output([group, ]nr)
- bits = gpio.dips()
- state = gpio.dip(nr)
SYNOPSIS
DESCRIPTION
These commands query the state of digital input/output ports. In the simplest form, the parameter nr indicates the output number of a port on the controller itself.
gpio.dip() gpio.input() gpio.output() |
Returns the current boolean state of the DIP-switch, input port or output port nr, respectively. |
gpio.dips() gpio.inputs() gpio.outputs() |
Returns the current state as an unsigned integer bit-mask. Bit 0 contains the first value, and so on. |
NOTES
On V4 architecture controllers, The first dip switch at nr 0 is always the "Debug Jumper".
EXAMPLE
Both examples are equivalent.
>
>
>
if (gpio.dips() & 8) then
print ("DIP 4 is on")
end
>
>
>
if (gpio.dips(4)) then
print ("DIP 4 is on")
end