#include <lua/gpio.lh>
- gpio.out([group, ]nr, state)
- gpio.pulse([group, ]nr, ms)
- gpio.blink([group, ]nr, pattern)
These commands modify the state of an output. In the simplest form, the parameter nr indicates the output number of an output on the controller itself.
| gpio.out() | Sets output to state, interpreted as a boolean. This call will stop any pulse or blinking running on the output. |
| gpio.pulse() | Pulse the output to on for ms milliseconds, the turn it off. Pulse timer will stop when gpio.out() or gpio.blink() is called on that output. |
| gpio.blink() | Blink the output with pattern. The pattern is an unsigned 32bit value which is rotated right every 125ms. On each rotate, bit 0 is placed onto the output. Blinking will stop when gpio.out() or gpio.pulse() is called on that output. (Note: uBus nodes only support an 8bit blink pattern.) |
Blinking with decreasing speeds:
Flash of 0.5s every 3.5s.