28123 Parallax Inc, 28123 Datasheet - Page 73

TEXT WHAT'S A MICROCONTROLLER

28123

Manufacturer Part Number
28123
Description
TEXT WHAT'S A MICROCONTROLLER
Manufacturer
Parallax Inc
Type
Programmingr
Datasheet

Specifications of 28123

Style
Book
Title
What's a Microcontroller?
Contents
Whats a Microcontroller? Text
Product
Microcontroller Accessories
Core Processor
PIC16C57c
Flash
128 Bytes
Operating Supply Voltage
9 V
Board Size
31 mm x 16 mm
Lead Free Status / RoHS Status
Not applicable / Not applicable
BASIC Stamp Bi-Color LED Control
Figure 2-20 shows how you can use P15 and P14 to control the current flow in the bi-
color LED circuit. The upper schematic shows how current flows through the red LED
when P15 is set to Vdd and P14 is set to Vss. This is because the red LED will let current
flow through it when electrical pressure is applied as shown, but the green LED acts like
a closed valve and does not let current through it. The bi-color LED glows red.
The lower schematic shows what happens when P15 is set to Vss and P14 is set to Vdd.
The electrical pressure is now reversed. The red LED shuts off and does not allow
current through. Meanwhile, the green LED turns on, and current passes through the
circuit in the opposite direction.
Figure 2-20 also shows the key to programming the BASIC Stamp to make the bi-color
LED glow two different colors. The upper schematic shows how to make the bi-color
LED red using
color LED glow green by using
signals to both P14 and P15 using
pins.
HIGH = Vdd
HIGH = Vdd
LOW = Vss
LOW = Vss
HIGH 15
P15
P14
P15
P14
and
Current
LOW 14
470 Ω
470 Ω
LOW 15
LOW 15
. The lower schematic shows how to make the bi-
and
and
1
2
1
2
HIGH 14
LOW 14
Current
. In other words, use
. To turn the LED off, send low
Figure 2-20
Manual bi-color
LED Test
Current through
Red LED (above)
and Green LED
(below).
LOW
on both

Related parts for 28123