book collections email follower instructable user

Step 5: Create Your New Program

Create a new sketch where you’ll paste in elements of all of your sample sketches to make your program.

In the loop, if you don't have a good example to follow or want to write it from scratch, paste in your pseudocode as comments to start. Then you'll start to create the logical overall structure of the program.

It’s possible one of your sample sketches already does most of your core structure, or to be easily able to find something online that does. It’s likely that somebody’s done something similar to your idea before, even if it uses different hardware. So I looked online, and I found a few membrane keypad door lock projects, all using this password library. So I downloaded the library and checked out the examples that come with it, and I got very lucky! There is a membrane keypad passkey evaluator sample that does exactly what I want. All I have to do is include my desired outputs, so code for the display and LEDs.

One really good practice while you're doing this is to compile your program really often. That way, if there's an error, you'll be able to isolate it to just the time you copied over such-and-such.

Here’s where it’s pretty critical that you pay attention to matching curly braces, missing semicolons, and other typos that would make your program hard to debug.