Moderator: igrr
Barnabybear wrote:Hi, not that I know of. The MCP23017 is a much better choice for more outputs and does have interupts.
Seems you are wrong. This guy uses it with interrupts.
https://www.youtube.com/watch?v=nXl4fb_LbcI
buzzy wrote:Seems you are wrong. This guy uses it with interrupts.
https://www.youtube.com/watch?v=nXl4fb_LbcI
Simple Answer: Yes!
Winded Answer:
This example uses the 74HC595 shift (SIPO) register ... and more importantly "diodes" ... the code first pulls all the lines high ... when a button is pressed ... any button ... it feeds voltage into a voltage divider and then it's feed into a gpio ... any gpio on the esp8266 (except gpio16) ... using attachInterrupt() (not going into detail here) you would declare the gpio to trigger an ISR (interrupt service routine ... look it up) then the code will one by one turn on each line (diodes prevent back voltage) to see what button(s) is(are) pressed ... the problem (not a problem if speed isn't a problem) here is the time it takes to poll all the buttons one by one ... this method is clever ... and works ... but there is a better way to handle extra inputs 74HC165 ...
https://github.com/sfranzyshen/74HC165-ESP8266
The nice things about using the 74HC165 for input is that you can use them along side using a 74HC595 to handle output ... and synchronously communicated to both chips using hardware SPI simultaneously ... even within the same function call ... way faster than any (bitbang) i2c expansion board ... way cheaper than any i2c expansion board ... and way more scale(able) ... and easier to code too!
byte 74HC165; // In
byte 74HC595; // Out
SPI.begin ();
{some latch manipulation code here}
74HC165 = SPI.transfer(74HC595); // BOOM!