Interesting… While I understand the SimpleTimer.h function better now, I don’t think it’s the fit I’m looking for. It can count, wait, repeat, do later, etc… What I’m looking for is more tuned to the quick code @Dmitriy wrote on the previous post (inset below).
void atticMagSensor()
{
current = digitalRead(5); // Attic Magnetic Switch connected to GPIO5
if (current != previous) { //only run if there is a status change from previous state
previous = current; //reinitialize
if (current == LOW)
{
doorClose()
}
else
{
doorOpen();
}
}
}
void loop()
{
Blynk.run();
atticMagSensor();
}
This compared with what I “tried” to do above in this post.
I’d like the code to feel free to check and re-check until something has changed. Until that event takes place, nothing is sent to or through the server. The SimpleTimer.h solution seems to be a, “wait for 250ms, then send it again” solution, similar in action to the delay(250); code.
I admit I’m not a coder extraordinaire, so I’m asking for some help and guidance .
Thanks in advance