top of page

I/O Project

Writer: Alexis SandersAlexis Sanders

For this project, I decided to create a combination lock. I wanted to explore game type styles with the Arduino later on and I figured this would be a good start to figure out how to program this. I started off by plugging in all my buttons and LED lights to determine whether or not the combination that was tried worked or not. I initially started with 4 buttons, but I switched to three to make the program less confusing and then I figured I could add the 4th button after I finished the code.

I started programming the buttons to turn the LEDs on depending on if the combination was correct or not. I started programming everything I used to the Serial monitor because that made it really easy to see what I was effecting and what wasn't working in my code. It took a while to write the code, but I started by going off the first digital input and output lab that we first went over in class since we had to control the LEDs with 2 bottoms. I then looked up information on how to use arrays and calling my own functions in this design since my testing and research on how to play with numbers and have them set based on their order. I also did some research on how to create a reset button with out any code using this website. This really helped me out a lot because it didn't need any code for the button to reset, it would connect back to the Arduino that the code needed to be reset.


I had some problems come up like the red LED light would stay on and I couldn't figure out where in my code I was calling it. I had to play around and figure out where the hidden on switch was, but ultimately I decided to include it in my code. I removed the green button since I figured it would take less time for users to figure out the code with 3 buttons rather than 4. I also had some trouble figuring out how to turn the LEDs on after the sequence was correct, but I managed to get them to turn on after each button was pressed correctly in sequence. If not the red LED stays on. I would like to incorporate some sound into this design to make it even more obvious that the person is pressing the wrong button because I don't think the LEDs are the best way to tell them that they are wrong. I did try to incorporate some delays with the lights to give it more of a blinking effect to get some better feedback, but I think that ultimately slowed the LEDs down.













Comentarios


bottom of page