Binary Puzzle

I said we'd take a little detour to make a fully functional puzzle using our two buttons and two lights and so I present to you, a Binary Puzzle. I have made two binary style puzzles before, one was purely mechanical , and the other one used a cabinet lock and a series of switches to activate it (but no blog post). Both of these are simpler ways of making the same puzzle so we need this to be different somehow. Since we have the full power of a microcontroller why not make the codes change over time. Every time you fail to enter the code correctly it will change the code, so let's dig into the system. Hardware wise it's a bit ugly, all of the information required to solve the puzzle is contained on the front of the panel which could be mounted in a box or in a wall. The reverse is just enough hardware to hold everything in place and some basic soldering to recreate everything on the previous prototype board. Two switches connected to D5 and D6 using the internal pull up...