vortigont / ESPAsyncButton

Event-based asynchronous button library for ESP32 family chips. It generate events for various button press patterns, like short/long press, clicks, autorepeat, multiple clicks
GNU Lesser General Public License v2.1
7 stars 1 forks source link

Multiplexer #13

Closed fishgrind closed 1 month ago

fishgrind commented 1 month ago

Hey,

Really enjoy your library have used it for multiple projects.

For my next project I want to expand my gpio pins using a multiplexer. How would I assign the adresses to a button as they would all use the same gpio pin.

vortigont commented 1 month ago

Hi! Thanks for your feedback. I did not get an idea of a multiplexer, how exactly are going to attach multiple button to a single gpio? I know there are i2c port expanders that are handled via i2c bus and it's own driver.

fishgrind commented 1 month ago

Thanks for the reply. Sorry I meant it that yes, it connects to the i2c.

Would your library still work with the buttons connected to the multiplexer?

vortigont commented 1 month ago

With multiplexer it won't work as-is since it's the multiplexer lib to decide when and how to read it's gpio's state. Though it is possible to create derived class from GenericButton that will work via expander and provide same set of events for clicks, etc... But how it will work and if would be asynchronous is solely depends on expander's driver.

fishgrind commented 1 month ago

Thanks for your time. I wil look into it!