Think of a curb that people keep tripping on to get into your shop.
A) ignore it.
B) Document it : "There's a curb here, step to the left." Kind of thing.
C) Remove the damn curb.
Micro controllers traditionally had a rough learning curve to use. There were a LOT of stumbling blocks in the way of a new user. The Arduino group chose to remove all of the stumbling blocks that they could. This is why the Arduino basically took over the micro controller landscape. Suddenly everyone could focus on the problem they wanted to solve, without dealing with all the nonsense of getting a micro controller running.
The Arduino people have done an amazing job removing the stumbling blocks so mr/mrs average can do something with a micro controller. But now new stumbling blocks have revealed themselves. For example delay() has become a trap for the unwary. Do we ignore it? Document the heck out of ways around it? Or just remove it?
I choose to remove it. And this is what LC_baseTools is all about. Removing the most common stumbling blocks that I see are left over. Also, why I didn’t go into how they work. Because its all about getting beyond them. Not to dwell on them.
I grant you, I’m a geek and therefor tend to be not the best at documentation. I should actually get someone else to do the documentation because I’m too close in.
The timeObj had two calls start() and stepTime(). start() started timing from now and stepTime() did the calculation from the last time it started. stepTime was for taking out accumulated error. Things like square waves. Anyhow, @SteveMann asked me to put in reset() to bring it back to a pre-timing state. It caused a bit of a re-thinking and rewriting of timeObj’s guts, but in the end I found that it was a very good addition. I wanted him to know I appreciated his idea and that I thought it was the right call.
Imagine you wrote a library that needs time during the main loop() to do periodic things. Like blinking an LED? You could make the user of your library call a function for this. OR.. You can add idle() to your loop, and everything from any library that needs time from loop() suddenly gets it. All in one go. For example, mechButton uses it to debounce stuff and calling callbacks. Blinker does it’s blinking during idle. I have a entire GUI library for doing handhelds that is completely run by.. idle().
But really, the first stepping stone is to get beyond millis and that’s why there is timeObj.