How to check if RST button is pressed 3 seconds?

All ESP8266 boards running MicroPython.
Official boards are the Adafruit Huzzah and Feather boards.
Target audience: MicroPython users with an ESP8266 board.
Post Reply
VladVons
Posts: 43
Joined: Sun Feb 12, 2017 6:49 pm
Location: Ukraine

How to check if RST button is pressed 3 seconds?

Post by VladVons » Sun Feb 16, 2020 10:16 pm

On a WeMos-D1-Mini ESP8266 development board there is one button - RST (reset)
Board can be rebooted after button press-release action.
While button is in a pressed state the application is still alive (i see terminal screen) but freezed
If i release a button than application reboots.
So i want to use long pressed state for clearing application settings.

How to catch pressed state reset button for more than 3 seconds?
Last edited by VladVons on Mon Feb 17, 2020 2:29 pm, edited 2 times in total.

User avatar
Roberthh
Posts: 1889
Joined: Sat May 09, 2015 4:13 pm
Location: Rhineland, Europe

Re: How to check if RST button is pressed 3 seconds?

Post by Roberthh » Mon Feb 17, 2020 10:42 am

If you push the reset button the device stops working and will do a complete restart when you release the button, comparable to a power cycle. That is a good hardware mechanism and not under control of any software.

Post Reply