You are reading a single comment by @Gordon and its replies. Click here to read the full conversation.
  • I'm not sure - what you're doing sounds fine. Maybe rather than setInterval you could just do a setTimeout after you've got the result? It might be simpler than having to have a boolean value as well?

    What are you actually reading the values for? Is it something that is likely to change quickly?

    If it's not going to change quickly, it might actually be worth checking even less often. If you're powering stuff off a battery you could power the sensors down when you don't need them, and checking every 10 minutes vs every 10 seconds would make a massive difference to power usage (if you care about that).

About

Avatar for Gordon @Gordon started