28123 Parallax Inc, 28123 Datasheet - Page 58

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
DO
LOOP
How LedOnOff.bs2 Works
The command
statement appear in the Debug Terminal. The command
Stamp to internally connect I/O pin P14 to Vdd. This turns the LED on.
The command
the LED stays on. The number 500 tells the
second. The number that follows
the BASIC Stamp Manual, you will discover that it calls this number the
argument. The name duration was chosen for this argument to show that the
command pauses for a certain ‘duration’ of time, in milliseconds.
The command
This turns the LED off. Since
off for half a second.
The reason the code repeats itself over and over again is because it is nested between the
PBASIC keywords
the code segment that turns the LED on and off with pauses between
the BASIC Stamp to execute those four commands over and over again. The result is
that the LED flashes on and off, over and over again. It will keep flashing until you
disconnect power, press and hold the Reset button, or until the battery runs out.
HIGH 14
PAUSE 500
LOW 14
PAUSE 500
What’s a Millisecond? A millisecond is 1/1000 of a second. It is abbreviated as ms. It
takes 1000 ms to equal one second.
LOW 14
DEBUG "The LED connected to Pin 14 is blinking!"
PAUSE 500
DO
and
causes the BASIC Stamp to internally connect I/O pin P14 to Vss.
LOOP
causes the BASIC Stamp to do nothing for ½ a second while
LOW 14
. Figure 2-12 shows how a
PAUSE
is followed by another
is called an argument. If you look up
PAUSE
command to wait for 500/1000 of a
HIGH 14
DO…LOOP
PAUSE 500
DO
causes the BASIC
works. By placing
and
, the LED stays
LOOP
makes this
Duration
PAUSE
, it tells
PAUSE
in

Related parts for 28123