3 Simple Ways to
Share What You Make

With Instructables you can share what you make with the world — and tap into an ever-growing community of creative experts.

PhotosPhotos

Share one or more photos of a project, recipe, or whatever you've made, quickly and easily.

Step by StepStep-By-Step

Share your step-by-step photos with text instructions of what you made so others can do it too!

VideoVideo

Share your how-to video. You'll need your embed code from a video site such as YouTube.

LED Umbrella with Arduino

Step 10Pushbutton Switch for Changing Programs

Pushbutton Switch for Changing Programs
The pushbutton switch is used to switch between programs. It triggers an interrupt on the Arduino which advances the program number. The Arduino Diecimilia (and others; check for your version) have two external interrupts that can be enabled on digital pins 2 and 3 using the attachInterrupt(interrupt, function, mode) function. Reserve digital pin 3 for the pushbutton switch. This leaves digital pins 0, 1, and 2 and 4, 5, 6, 7, 8 as blocks for the anode pins.

The interrupt is set to trigger when pin 3 goes low. It must therefore be held high until the button is pushed, at which the pin goes low. This requires a 10K pull-up resistor to hold the pin high. See the breadboard image and read about pull-up and pull-down resistors.
« Previous StepDownload PDFView All StepsNext Step »

Pro

Get More Out of Instructables

Already have an Account?

close

All Steps Viewing
View all steps of an Instructable on the same page when you're a Pro Member.

Upgrade to Pro today!
36
Followers
7
Author:matth3w