Updated MCP23008 MCP23017 (markdown)

andrethomas 2018-08-18 16:44:57 +02:00
parent 616bf1d6d3
commit 911362ba18
1 changed files with 6 additions and 1 deletions

@ -263,6 +263,11 @@ sensor29 0,T // Toggle the current state of pin 0 from HIGH to LOW or LOW to
Telemetry data is provided for pins which are enabled for output. For example, if pin 0 was enabled for OUTPUT the following additional telemetry message will be sent by MQTT at the same time as the normal telemetry interval occurs which reports the current states of pins.
`MQT: tele/sonoff/SENSOR = {"Time":"2018-08-18T16:24:50","MCP230_OUT": {"OUT_D2":"OFF","END":1}}`
```
MQT: tele/sonoff/SENSOR = {"Time":"2018-08-18T16:41:20","MCP230XX":{"D0":0,"D1":0,"D2":1,"D3":0,"D4":0,"D5":0,"D6":0,"D7":0}}
MQT: tele/sonoff/SENSOR = {"Time":"2018-08-18T16:41:20","MCP230_OUT": {"OUT_D4":"OFF","END":1}}
```
Note the MCP230XX telemetry which provides the current logic state of all the pins and then the second MQT telemetry as MCP230_OUT which indicates the current state of pins configured for OUTPUT - In this case pin 4 or D4
Remember to adhere to the current limitations of OUTPUT pins when using the device for switching external devices such as LED's - Relay's will need additional circuitry as the MCP23008/MCP23017 cannot drive relays directly - That being said most readily available relay pc boards available from vendors are optically isolated from the input so these will work perfectly.