GPIOS Configuration
The GPIOS can be configured from the configuration file (conf-user.h
) to set a default mode or direction (INPUT/OUTPUT) and to indicate if we want to transmit its status to the remote server.
This is the default configuration (empty/disabled)
#define ADD_MSG_PINS -1
#define OUTPUT_PINS
#define INPUT_PINS
#define MASTER_GPIO IO6
Property | Desc |
---|---|
ADD_MSG_PINS | Comma separated list of pins to add to messages. When a message is created the GPIO module will read the status of this GPIOS, configured as outputs. |
OUTPUT_PINS | Comma separated list of OUTPUT pins. On startup the method pinMode(GPIO; OUTPUT) of arduino will be executed on each pin. |
INPUT_PINS | Comma separated list of INPUT pins. On startup the method pinMode(GPIO; INPUT) of arduino will be executed on each pin. |
MASTER_GPIO | A single pin used as the main GPIO. The web application has widgets and special functions to control this GPIO |
Usage Example
#define ADD_MSG_PINS IO3, IO4, IO5
#define OUTPUT_PINS IO0, IO1, IO2
#define INPUT_PINS IO3, IO4, IO5
#define MASTER_GPIO IO6
In this configuration example we are defining the following:
- Transmit status of gpios IO3, IO4 and IO5 to the remote server (
ADD_MSG_PINS
) - Set GPIOS IO0, IO1 and IO2 as OUTPUTS (
OUTPUT_PINS
) - Set GPIOS IO3, IO4 and IO5 as INPUTS (
INPUT_PINS
) - Use IO6 as Master GPIO (
MASTER_GPIO
)