I started out by using the make it switch and make it change tutorials on arduino's website. I then combined the two tutorials into one script. I had an issue originally where my switch wouldn't work, however I solved that issue easily by just moving the begin circuit playground line before the pinMode line.
My toggle switch works off of an if statement that has the light and sound code in it, which turns the code off and on. The potentiometer controls the speed that the lights and sounds go. I used a global variable to store the value of the potentiometer in it, and I doubled the value when I run the delay.
Pictures from assembling the prototype.
video linkhttps://youtube.com/shorts/H61aujlhpAQ?feature=share









Comments