01

<<< home | H79.2301 - Introduction to Physical Computing | W1-Combination Lock (failed)

Every attempt I make at cracking this puzzle seems to get me further away from any sort of solution and closer to remotely comprehend what not to ask of my Arduino. Having no real experience in programming, I keep attempting the impossible 2 actions in one to no avail.

First attempt: Trying to basically combine “Blink” with “Switch”. Using the same setup as “Switch”, counting how many times the red LED turns itself on within an alloted time of 5 seconds. I connected another white LED to indicate when to enter the code. the white LED was programmed to turn itself in intervals of 5 seconds 3 times. If the number of clicks for each light cycle matched the one I have set, a pair of additional LED’s would switch from red to green indicating success.

There was no success. the reason for that was, that while the white LED did function as a timer, nothing else worked!

Second attempt: Back to the drawing board, how can I make it do it all at the same time? I thought, why not use a “while” command (whatever that means…) I’ve replaced the switch with a push button and added an additional one. this time I will try to allow entering the code only while the extra push button is pressed, counting three cycles of that and checking if the variables end up matching the code. Failed again, the routine got stuck at the very beginning, lighting up both LED’s (yellow and white), and that was that. For some reason I can’t manage to figure out how to put things in order… yet.

fail-1
fail-2