Interesting comments below but I found that if you move the print statements to inside the ISRs you will see that there are no counts missed. In addition change the attachInterrupt for the switch to FALLING Instead of CHANGE and you get single counts each time. Doesn't need any other debouncing . Thanks for the vid!
Where can I find code and/or a library that handles detents/debounce correctly? I've moved the print statements to inside and Isr's, and changed the state to FALLING, but this still give very crazy results (because of the detents). The button is also counting multiple times per push. Help?
I was supprised too to see no debouncing. Push switch counts multiple times per push. That is generally a disaster. In video there are jumps of tens of counts and I doubt the switch was pushed that many times. With arduinos I've seen most often timer interrupts polling manual switches and taking it a press when it has several same values ie. has settled. Rotary value often just bounces up/down several times until it settles. Depending on need that may be fire or it may be a disaster when the rotary counts like up-down-up-down-up-down-up-down-up(settles).
Hi, thank you very much for the valuable contribution of the ESP32 ... I wanted to ask if it would be possible to show the Wi-Fi signal level of the ESP32 module in a series of 5 LEDs, for example connected each one to an output GPIO showing the level of the signal in a percentage in each of the led, that is 5 led = 20% - 40% - 60% - 80% - 100%. (Is there an AT command to interrogate the module requesting Wi-Fi signal level?) I hope I have explained and thank you very much. I am attentive to your opinion. regards! Diego
Very helpful thx. I have just one Porblem and thats that its not very accurat it changes sort of in the right direction but sometimes a little bit in the wrong direction and i was wondering if anyone knows why that ist and what maybe to do about it.
Interesting comments below but I found that if you move the print statements to inside the ISRs you will see that there are no counts missed. In addition change the attachInterrupt for the switch to FALLING Instead of CHANGE and you get single counts each time. Doesn't need any other debouncing . Thanks for the vid!
I just got the same sensor kit a week ago. 👍🏻
ai-esp32-rotary-encoder library version 1.5 released. Might help with rotary encoder functionality
I dont like this code. It doesnt count like it should. And i think begginers shuldnt use it for learning...
why did u make it so it goes up and down in 4s instead of 1s
Where can I find code and/or a library that handles detents/debounce correctly? I've moved the print statements to inside and Isr's, and changed the state to FALLING, but this still give very crazy results (because of the detents). The button is also counting multiple times per push. Help?
portMUX_TYPE gpioMux = portMUX_INITIALIZER_UNLOCKED;
'portMUX_TYPE' does not name a type
have this error in the code could helpme !
debouncing is important
I was supprised too to see no debouncing. Push switch counts multiple times per push. That is generally a disaster. In video there are jumps of tens of counts and I doubt the switch was pushed that many times. With arduinos I've seen most often timer interrupts polling manual switches and taking it a press when it has several same values ie. has settled.
Rotary value often just bounces up/down several times until it settles. Depending on need that may be fire or it may be a disaster when the rotary counts like up-down-up-down-up-down-up-down-up(settles).
Hi, thank you very much for the valuable contribution of the ESP32 ... I wanted to ask if it would be possible to show the Wi-Fi signal level of the ESP32 module in a series of 5 LEDs, for example connected each one to an output GPIO showing the level of the signal in a percentage in each of the led, that is 5 led = 20% - 40% - 60% - 80% - 100%. (Is there an AT command to interrogate the module requesting Wi-Fi signal level?)
I hope I have explained and thank you very much. I am attentive to your opinion. regards!
Diego
Is it possible to connect 8 rpm sensors to esp32 and measure using interruptions?
Very helpful thx. I have just one Porblem and thats that its not very accurat it changes sort of in the right direction but sometimes a little bit in the wrong direction and i was wondering if anyone knows why that ist and what maybe to do about it.
key word = debouncing