This week in lab, we used what we had made in the last few classes to make a construct that was vastly more complicated involving more enhanced coding techniques and more logical statements to clear up our coding.
Digital Read and write became our best friends for a while. These functions allowed us to read the status of the button and lights were, while write: gave us the ability to change that status so that we could execute a function.
Since we had multiple lights we had to copy this code a lot so instead we used an array of numbers to represent the lights and turn them all on. Once we understood this it was pretty easy to get other commands we wanted. We just had to adjust the delays of the blinks and the order of delays and commands. This would change the entire ability of the button and the lights. We were told we could NEVER use the delay function again, so things will get interesting from now on.
unfortunately my teammate has the code so, iw was not able to get the best pictures…
Stuttering was an issue for my group at first so we did have to debounce our button. In order to do this we added a delay to our button reads. This allowed us to get accurate readings in our code to use for the digital read.