Hi forum,
I have an esp32-c3-wroom-02 based board with 2 buttons, one for boot loader and one for reset. I'm able to put my controller into download mode to upload my code by pressing the RST button while pressing the boot button.
This works fine. However, I need to be able to associate a piece of code to the RST press. Seeing as the RST is part of the controller logic, a single press will restart the controller. I was wondering if maybe I could detect a long press and associate a function with it.
Any idea if this is possible?
ESP32-C3 - Double use for RST button
-
- Posts: 9727
- Joined: Thu Nov 26, 2015 4:08 am
Re: ESP32-C3 - Double use for RST button
Not in code. The ESP32 is entirely halted in reset state during the time that RST is pressed, so there's no way to detect a long press in software. Best you could potentially do is add an external RC circuit to another GPIO, with the C only discharging entirely in a long press, and use that GPIO to detect that in sofware. Alternatively, the BOOT button is connected to GPIO9 and functions as a normal button after boot, so you're free to use that for whatever function.
Re: ESP32-C3 - Double use for RST button
Thank you so much ESP_Sprite! That just saved me a lot of work! Thank you!
Who is online
Users browsing this forum: No registered users and 64 guests