-
-
Notifications
You must be signed in to change notification settings - Fork 63
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Delay in Reading #65
Comments
Will take a look |
I checked the submitted code and the very first thing that I noticed is the use of Delay(xx). While delays can be usefull sometimes, they have the side effect of stopping the cpu until amount of time is reached. Instead, try to implement a status driven type of code, where you each task required a previous one is coded with a flag (status) indicating (or not) to perform it. So yes, the problem is the code: Delays and too compact code |
Thanks, removed the delay functions and code now runs without issue. |
Here is my code below. I am using the Easybutton library for reading the button state. Problem is that in the loop function, even when I press my button for 2 seconds, it does not detect that and takes more time to detect, and even the detection is unreliable. I am sure there is a problem in my code, just can't figure it out. Please help.
Platform : NodeMCU
IDE : Arduino
The text was updated successfully, but these errors were encountered: