Microcontrollers are very powerful tools for exploration into the electrical world. In this tutorial we will be using Arduino's Uno board, and we will show you how to program a number of basic functions into a breadboard bike light. To allow for switching between the various function of the bike light we will show you how to physically debounce a button and use an interrupt in Arduino code. Also we will show you how to set up a basic voltage divider to measure the value of a photoresistor, and how to power your Arduino externally so that it could be removed from your computer.
Step 1: The Materials
For this instructable you will require the following in addition to your arduino board:
1. A breadboard
2. 5 LEDs
3. A standard pushbutton
4. An inverting shmidt trigger
5. A 10 uF Capacitor
6. A 10k Ohm Resistor
7. A bunch of wires (not pictured)
8. Some kind of power supply from 5V-9V that doesn't need a whole lot of current. (optional)
Step 2: Setting up your Arduino
Firstly download the Arduino IDE and set up your arduino to work with your computer following the instructions found here: http://arduino.cc/en/main/software
Once it's set up there should be an icon on your computer that looks like the arduino logo, and once you open it, the program should look like this, but without the code. That part comes later.