Using additional buttons without affecting rotary menu #85
-
Hello. I have a need to add 2 buttons to a project that are not associated with the rotary encoder or any part of the menus. The 2 buttons just need to execute some function separately. When I try to use these simple buttons either by polling their state such as digitalRead(GREEN_BUTTON_PIN) or by attaching an interrupt such as attachInterrupt(digitalPinToInterrupt(GREEN_BUTTON_PIN), checkGreenButton, FALLING); the rotary menu stops working. Here is a link to the project. If you uncomment the red or green button code it causes issues with the rotary functionality : https://wokwi.com/projects/392458742047807489 Any advice would be greatly appreciated. |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 6 replies
-
Hello, @acabrera2012! Thank you for providing Wokwi implementation! Indeed, it seems that rotary encoder button is not working reliably for some reason (regardless of presence of another buttons). I will look into it. However, there are couple of things I've noticed at a quick glance: in Wokwi environment it is better to set Will investigate further. |
Beta Was this translation helpful? Give feedback.
-
Sounds good. Let me know what you find. Just to be sure, here is the link to the Wokwi project again: https://wokwi.com/projects/392458742047807489. Thanks again. |
Beta Was this translation helpful? Give feedback.
-
Who would have thought, seems like a memory issue after all=) As soon as I've changed all of Here's Wokwi: https://wokwi.com/projects/392813742679205889 |
Beta Was this translation helpful? Give feedback.
Who would have thought, seems like a memory issue after all=)
As soon as I've changed all of
Serial.println()
calls to useF()
macro everything works just fine.Here's Wokwi: https://wokwi.com/projects/392813742679205889
Here's Gist: https://gist.github.com/Spirik/abf77ccd9cd309d67b5d8ead0599a06b