I’m am working on some lighting animations for our robot this year and during testing, I was using Timer.delay() for most of the functions such as filling up the strip from the middle to outside or from one side to the other. I soon realized that the delay function halts the thread the code is running on and I wondering what would be the best way I could set up a timer that would not cause any issues with the robot running normally.
Create a Timer instance and use the reset() and hasElapsed() or advanceIfElapsed() functions to determine if a certain amount of time has passed and optionally reset the timer.