Sloppy Switches - Elenco Electronics SNAP CIRCUITS XP SCXP-50 Instruction Manual

Table of Contents

Advertisement

Project B7
Optional:

Sloppy Switches

Build the circuit as shown. Turn on the slide switch (S1). Load program
Sloppy Switches into the microcontroller (U21) using the programming
instructions in project B1.
Push the press switch (S2) several times. Each time you press it the red LED
(D1) should toggle (turn on or off). But sometimes it will just flicker and not
change. Press the switch enough times to see this happen.
This effect makes it appear the switch isn't working, or the microcontroller
isn't watching it carefully enough. Do you know what is really happening?
Most switches use a metal contact that snaps into place. This action may
cause the switch to bounce and produce "switch noise" when it is closed. This
can cause equipment to think the switch was pressed more than once, and
so cause improper operation.
The program tells the microcontroller to
monitor input pin 3, where the press
switch is connected. Every time the
switch is pressed, the microcontroller is
to toggle (turn on or off) the red LED
(D1) at output pin 0.
The input pins on the microcontroller
have two states - 1 (on, or high, or
having strong voltage) or 0 (off, or low,
or having no voltage). If the electrical
signal is somewhere between these, the
microcontroller may get confused.
-40-

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Snap circuits xp

Table of Contents