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.

Swiss AVR Knife

Step 13Preparing the Pushbutton Switch

Preparing the Pushbutton Switch
Prepare a short piece of solid wire by forming it into a U-shape the fits snugly over the bottom of the switch. Apply a blob of solder to either side of the hole -- leave room for the switch -- and position the switch in place. Melt the solder and push the wire in place. Let the solder harden and repeat on the other side. This should position and secure the switch in place.

Prepare two pieces of stranded wire by cutting to length and stripping both ends. Make sure that the wires are long enough so that the lid of the tin can fully open. Solder to two appropriate pins on the switch and then slide pieces of heatshrink tubing over the joints to protect and strengthen them. Solder to other to ends into their respective holes on the board.

Carefully thread the wires between the LEDs and make sure they don't sit on top of the batteries. I spread the two pins on the switch so that the rightmost LED slipped between them. The pins on the switch are VERY fragile (the other two snapped off).

Note the pin PA7 PCINT7 6 is set up to listen for a change in state. Pressing the pushbutton switch pulls the pin high and SIGNAL(PCINT0_vect) is executed. Based on the length of the button press, either nothing happens (crude debouncing), the state is advanced (short press), or the program is advanced (long press).
« 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