This week I applied some of the in-class coding lessons to an interactive LED Circuit. My main idea was to create a system where half the LEDs go off and once interaction happens the other half would go off. In the simple example, I created this week, the 1st, 3rd, and 5th light go off together in a row, then the 2nd and 4th go off together once the potentiometer changes reading.
I found success in creating what I wanted to for this week, though I certainly see the potential for similar code to be used on a larger and more complex scale. For more on that see the end of the post. The challenges I encountered were mainly associated with knowing how to order the code for it to work properly. I knew all the pieces necessary for this idea to function, but I wasn't sure what had to happen first. Once I was able to figure that out, the code worked well. The only problem that remains is the last LED in each light sequence doesn't fade in and out, it just flashes on. I still don't know why this is only happening to one of the lights. The other problem I had was more of an issue with the hardware, I wanted to make this with 6 lights, but it seems like there is a small piece of metal jammed into 'pin 8' of my Aurdino. I hope to figure out how to remove it or get a new one for next week.
Here is the code for the circuit:
Here is a top view of the circuit:
Here is a front view of the circuit:
Here is the video of the circuit working:
Comments
Post a Comment