Hello, I am trying to accomplish something relatively simple but can not seem to wrap my head around how to implement a delay without a delay in one of my current projects. Its a game where you run towards the arrows on the field and when you reach a certain point, an arrow turns green and you must run around the obstacle.
(3) mini lidar sensors actively receiving serial data on a players distance
(2) FastLED ran 'arrow’s with 3 segments of LEDs inside each
Once the player reaches a certain point (triggerValue) I want the arrows to randomly choose a direction and stay a color until it time outs (currently using a 10 second delay() in my code.)
The video doesn’t really show it that well but I have everything working- but the delay() makes the arduino either double trigger, or act erratic for a few seconds afterwards. As this is a permanent, public display, I would like to eliminate the use of the delay and basically move to a function that does nothing for a certain amount of time without disrupting the running average or LED output. After I get this issue resolves I also need to add and override button to immediately jump to the trigger function, regardless of its current location in the code. As I said- its a very simple concept but I have tried a few iterations and cant seem to have it “BwoD” in a sense. Thanks in advance guys\gals.