miketeachman / micropython-rotary

MicroPython module to read a rotary encoder.
MIT License
269 stars 56 forks source link

Esp32 #1

Closed zoide closed 5 years ago

zoide commented 5 years ago

I have added ESP32 support. Actually I did only 'remove' the pin-array. ESP32 can do interrupts on all GPIOs.

miketeachman commented 5 years ago

thanks for this contribution to the driver ! One thought - did you consider what will happen if a rotary encoder is connected to one of the GPIO "strapping" pins on the ESP32? For example: consider if the rotary encoder uses GPIO0 - there is a 50/50 chance that the encoder will pull-down GPIO0 when the ESP32 starts after a reset or powerup - this would result in the ESP32 entering the download state rather than booting from flash memory.

For the ESP8266, this driver does not allow any of the strapping pins to be connected. I was thinking that it might be wise to consider the same design approach for the ESP32. What do you think?

references: https://www.esp32.com/viewtopic.php?t=5970 https://www.espressif.com/sites/default/files/documentation/esp32-wroom-32_datasheet_en.pdf (pages 4/5)

zoide commented 5 years ago

I briefly thought about that issue. I did not create the blacklist, since a believe that people know what they're doing ;) added an update with a blacklist.

miketeachman commented 5 years ago

This looks great! Thanks very much for time and patience to make this change.