This past week we learned just how useful state machines can be. We are now able to do things that we couldn’t do with delay due to the nature of the delay function. Using state machines allows us to have our Arduino focus on multiple tasks as well as multiple different timers which can allow for much more complex projects. We had a few different exercises to work on to help with our understanding of state machines.
I found the state machines fairly easy to understand and didn’t face many difficulties when attempting to create the following sketch.
While I know how to use the state machines fairly well I feel like my code can still be improved, I still find myself using large groups of nested if statements and switch statements which make the code look fairly clustered and challenging to read. I hope to be able to keep practicing my coding techniques to shorten down the amount of code needed to produce the same effects.