book collections email follower instructable user

Step 4: Test Hardware

Picture of Test Hardware
idea-to-code-arduino-optimized-09.jpg
idea-to-code-arduino-optimized-07.jpg
idea-to-code-arduino-optimized-08.jpg

Next step: select and evaluate hardware components that could work for your inputs and outputs. It’s a little more complicated than just making sure you have enough pins available, but I’ll save my hardware selection advice for another tutorial (leave your questions in the comments). Here's a great guide about microcontroller selection.

Build and run a sample for each component you’re working with. This involves downloading any relevant code libraries, and checking out example code that tests you’ve wired it up correctly. For inputs, you’ll use the serial monitor to get some feedback. In my case that's a membrane keypad using the keypad library.

And then I added an alphanumeric display with an i2c backpack, and three different colored LEDs each with their own resistor. I uploaded the sample code for the display to verify it’s connected properly, then ran a simple blink sketch to test the LEDs. In both case I found wiring errors I needed to fix.

It’s easier to discover that something is wired incorrectly at this stage, when you’re working with code that’s known to work with the component at hand rather than trying to debug wiring and code at the same time.

Start writing comments in your code that explain what each section does.