Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

3
  • Yes, your are right! That's also the way I decided to go. Though, I tried to achieved this to have a more convenient implementation of the library: This if(ready==true) could theoretically be somewhere in loop(). But my periodically checking is VERY time-sensitive. If I call the function to check in the if(), I have to be sure, that there is no delay which alters the result. Commented Sep 12, 2015 at 2:59
  • Now it is like: void loop() { freqdetec.checkFreq(); if (freqdetec.freqChanged()) { // do stuff } } The benefit from separating it into two calls is first, that it is more obvious what the single calls are doing, and second, I can place the checkFreq() in the beginning of the loop(), to avoid having it cluttered somewhere. Commented Sep 12, 2015 at 3:04
  • As another person answered, if it is highly time-sensitive you could use an interrupt (if this is a switch you are checking), or a timer firing periodically (if you need to test something like an analog reading). Commented Sep 12, 2015 at 3:09