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.

Reading Switches with ATtiny2313

Step 8Using The switch/case Construct

The final step is "just software": As promised, we'll implement the switch/case construct. Although this example only shows two alternate actions, it should be very clear how to use this construct to select one of several alternate code sections. In operation, this program monitors the switches and if there is a change, it will beep the appropriate number if it is odd ; it'll blink if the number is even. It does nothing unless a switch changes.

To run this code, create a new directory (call it Switch if you like) and download the following C code file and makefile into it. Rename Makefile3.txt to just Makefile. Using WinAVR, compile the program and load it into your Attiny2313.
« 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!
41
Followers
8
Author:doctek