-
Notifications
You must be signed in to change notification settings - Fork 53
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
reading on every update()? #7
Comments
Hrm. Battery aside, updating -- actually calling analogRead() I would guess -- on every loop iteration affects other things. For example, on an ESP8266, it causes the WiFi module to go non-responsive. If I call So, while I can surely add such a delay to all of my sketches, I think it needs to be reconsidered if this library really ought to be doing an |
I guess it is you who decide when you call |
Of course, I, and everyone else could write Do you not think doing so right inside the library so that |
Not maintainer just a library user. But in my opinion it belongs in userland (deciding when to update). |
As mikegleasonjr said, the library is only called every loop if you call it every loop. It's deliberately up to you as a dev when to call update, because the frequency at which you call it will affect some of the parameters you'll use. |
I think, looking at the source for your library, that you are reading the analog input on every iteration through the main Arduino
loop()
, yes?Is that necessary? Wouldn't it be hard on a battery powered application?
The text was updated successfully, but these errors were encountered: