mirror of https://github.com/arendst/Tasmota.git
Updated MCP23008 MCP23017 (markdown)
parent
aec3877376
commit
61fbd8515b
|
@ -178,4 +178,34 @@ In the example above the rule would respond to an interrupt of HIGH on pin 0 of
|
|||
|
||||
See the Wiki on [Using Rules](https://github.com/arendst/Sonoff-Tasmota/wiki/Rules) for more information on how this can be helpful to your requirements.
|
||||
|
||||
_Finally, keep in mind that the MCP23008/MCP23017 chip will only store the last interrupt registered in the interrupt register and capture register - Because the interrupt register is only checked every 50 milliseconds by the Tasmota firmware you may experience missed interrupts if your incoming signals fluctuate/change faster than 20 times per second._
|
||||
_Finally, keep in mind that the MCP23008/MCP23017 chip will only store the last interrupt registered in the interrupt register and capture register - Because the interrupt register is only checked every 50 milliseconds by the Tasmota firmware you may experience missed interrupts if your incoming signals fluctuate/change faster than 20 times per second._
|
||||
|
||||
|
||||
***
|
||||
### EXPERIMENTAL OUTPUT FUNCTIONS
|
||||
|
||||
An output version of xsns_29_mcp230xx.ino can be found here https://github.com/andrethomas/Sonoff-Tasmota/blob/mcp230xx_output/sonoff/xsns_29_mcp230xx.ino
|
||||
|
||||
Replacing the original file with the one above will allow you to enable experimental OUTPUT support by adding the following compiler directive to your user_config.h
|
||||
|
||||
`#define USE_MCP230xx_OUTPUT`
|
||||
|
||||
This will extend the sensor29 command enabling pinmode 5 for output, for example:
|
||||
|
||||
```
|
||||
sensor29 0,5,0 // Configure pin 0 as OUTPUT and default to LOW(0) on reset/power-up
|
||||
sensor29 0,5,1 // Configure pin 0 as OUTPUT and default to HIGH(1) on reset/power-up
|
||||
```
|
||||
|
||||
If SAVE_STATE / setoption0 is enabled in your firmware configuration then the last known state of the pin will be used on power-up/reset thereby ignoring the pull-up parameter in the commands above.
|
||||
|
||||
To change the state of an output pin you may use:
|
||||
```
|
||||
sensor29 0,ON // Turn pin 0 ON/HIGH/1
|
||||
sensor29 0,OFF // Turn pin 0 OFF/LOW/0
|
||||
sensor29 0,T // Toggle the current state of pin 0 from HIGH to LOW or LOW to HIGH
|
||||
```
|
||||
|
||||
Please note that this functionality is EXPERIMENTAL and support is not guaranteed.
|
||||
|
||||
As at the time of writing this, the above functionality is not yet staged for implementation in the Tasmota development branch.
|
Loading…
Reference in New Issue