beautypg.com

Project a4 electronic counter – Elenco XP&trade User Manual

Page 14

background image

Project A4

Electronic Counter

Note:

This circuit requires

program Electronic Brain to be in
microcontroller U21’s memory.
This is loaded into U21 at the
Snap Circuits

®

factory and should

still be there, unless you already
reprogrammed it. If it has been
reprogrammed, you must use
project B1 (on page 29) to load
program Electronic Brain back into
U21 before building this circuit.

The circuit will count how many
times you press switch S2, then
announce the answer by flashing
LEDs.

Turn on slide switch (S1) and wait
a moment for the green LED
(D2) to come on. Slowly press

switch S2 up to 255 times; the
red LED (D1) flashes each time.
Then wait 10 seconds.

After 10 seconds, the
microcontroller (U21) recog-
nizes that it is time to display the
count. The green LED will turn
off, and then the green & red
LEDs will flash based on the
number of S2 presses. The green
LED will flash first and each flash
counts as 4, then the red LED
will flash and each flash counts
as 1.

For example, if you pressed S2
14 times, the green LED will
flash 3 times (representing 12,
since each counts as 4) and the

red LED will flash 2 times (12 + 2
= 14).

When the microcontroller
finishes displaying the count, the
green LED will stay on, indicating
the microcontroller is ready for
you to press S2 more.

The total is cumulative, and so
includes earlier presses in
counting mode. Turn slide switch
S1 off and on to reset the count
to zero.

When pressing S2 to count, do
not press it rapidly on and off, or
the microcontroller may miss
counts. The red LED should blink
after each count.

Part B: 64 second timer

Turn slide switch S1 off and on
to reset the circuit, and wait for
the green LED to come on. Push
press switch S2 and hold it down
until the green LED turns off.
After a short pause, the red LED
will come on and stay on for
about 64 seconds.

-13-

We measure many things in
quarters. This picture shows
only a few of them. How many
more can you think of that uses
a system like this?