Digital Pin
Digital pins are simple ON/OFF pins. They allow you to read an input or write to an output.
Paths
The state of a digital pin is available on the path gpio/{pin-id}
and, for
output pins, commands can be sent to gpio/{pin-id}/set
. Values for pin
states are ON
or OFF
.
Path |
Description |
---|---|
|
If you need more precise timing, this allows you to specify a time and, optionally a state, to toggle a pin for. If another command is sent while a pin is being pulsed, the pulse will be cancelled. The message should be a JSON string with the following elements:
|
|
Pin state will be published here as |
|
Send |
|
See pulse above, |
Configuration
The following additional options are added to the configuration. Optional settings are commented out with default values shown.
gpio:
#debounce: 50
pin-id:
#pin mode: 'input'
#resistor: 'off'
digital:
#interrupt: 'none'
#invert: false
#initial state: OFF
batch-id:
#pin mode: 'input'
#resistor: 'off'
digital:
#interrupt: 'none'
#invert: false
#initial state: OFF
Module Settings
Option |
Description |
---|---|
|
Pin change interrupt debounce time in milliseconds. Optional, default |
Single and Multiple Pin Definitions
Pin configuration section names must be unique as they are used as property IDs.
Property IDs can only contain lowercase letters a-z
, numbers 0-9
, and
hyphens -
. The following settings apply to both single and multiple pin
definitions:
Option |
Description |
---|---|
|
Pin mode, can be Optional, default |
|
Pin pull resistor for inputs, can be Optional, default |
|
Pin change interrupt, can be Optional, default |
|
Logic invert flag, can be Optional, default |
|
Initial state to set the pin to, must be one of
Optional, default |