Arduino digital input and output tutorial
In this tutorial and accompanying youtube video (left), I discuss how Arduino inputs and outputs work. Arduino 8 bit
boards are mainly based on Atmel AVR chips, in fact the Mega is named after the chip number AVR-Mega-2560.
Outputs on the AVR chips are much more versatile than they first look, and the video covers this in detail.
If you are using an Arduino pro or other 3V3 based Arduino, replace the 5V mentioned here with 3V3.
Working with and de-bouncing switches for Arduino
When we press a button that’s connected to an Arduino input, it is likely that the button will momentarily “flicker” between the on and off state. This gives false readings for a short period of time after the button is pressed. Problems caused by this can range from the mild annoyance of a slight flicker, to doing something more than once that should have only happened once. Therefore we need a way to ignore these false readings; ensuring we only consider the button pressed or released when we know for sure that it is “stable”. Before we can go any further, we need to understand why we get “bounce” on switches. Please also see the youtube video (over to the left) for a detailed explanation.