Updated MCP23008 MCP23017 (markdown)

andrethomas 2018-08-04 01:18:49 +02:00
parent 9d04701252
commit b98d8a6b01
1 changed files with 21 additions and 7 deletions

@ -46,19 +46,33 @@ This option only requires the main define to be uncommented prior to compilation
`#define USE_MCP230xx` `#define USE_MCP230xx`
There is a single command that may be used for resetting all pins to INPUT with the weak internal pull-up resistor DISABLED as follows: The behaviour of all pins on the MCP23008/MCP23017 can be reset to a specific setting/mode globally to simplify the initial configuration as follows
`sensor29 reset` ```
sensor29 reset // Reset all pins INPUT, no interrupt, no pull-up by default
sensor29 reset1 // Reset all pins INPUT, no interrupt, no pull-up by default
sensor29 reset2 // Reset all pins INT on CHANGE, with pull-up enabled by default
sensor29 reset3 // Reset all pins INT on LOW, with pull-up enabled by default
sensor29 reset4 // Reset all pins INT on HIGH, with pull-up enabled by default
```
This will be confirmed by a response like this - note the 99's indicated in each value to differentiate it from other MQTT responses The command will respond with confirmation as follows:
`MQT: stat/sonoff/RESULT = {"Sensor29":{"D":99,"MODE":99,"PULL-UP":99,"STATE":99}}` `MQT: stat/sonoff/RESULT = {"Sensor29":{"D":99,"MODE":pinmode,"PULL-UP":pullup,"STATE":99}}`
You may also query the existing configuration for a particular pin using Pin and State is reported as 99 because it was implemented accross all pins.
`sensor29 pin,?` Mode should correspond with the reset pinmode option used.
For example: Internal pull-up resistors on the MCP23008/MCP23017 is disabled by default for pin mode 0 whilst enabled by default for pin modes 2 through 4.
If specific pins require specific configuration after this command has been issued the pins may individually be configured using:
`sensor29 pin,pinmode,pullup`
The usage of the above is described in more detail further in this page.
The configuration of a specific pin may be queried using command:
`sensor29 0,?` `sensor29 0,?`