Recently I have been building a robot, but I have been thinking of a way to make a one button toggle. I was hypothesizing of using a for loop and adding a bit everytime it was pressed, then it would execute the code inside the for bracket.
Put simply, how could I have the mcu check for an input, delay x amount of time then if the button was still on it would execute the code?
Put simply, how could I have the mcu check for an input, delay x amount of time then if the button was still on it would execute the code?