28123 Parallax Inc, 28123 Datasheet - Page 91

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
LOOP
How PushbuttonControlledLed.bs2 Works
This program is a modified version of ReadPushbuttonState.bs2 from the previous
activity. The
replaced with an
= 1)
executed until the
ENDIF
commands after the
You can make a detailed list of what a program should do, to either help you plan the
program or to describe what it does. This kind of list is called pseudo code, and the
example below uses pseudo code to describe how PushbuttonControlledLed.bs2 works.
DEBUG ? IN3
IF (IN3 = 1) THEN
ELSE
ENDIF
HIGH 14
PAUSE 50
LOW 14
PAUSE 50
PAUSE 100
, the commands that come after the
and moves on. When the condition after the
Do the commands between here and the Loop statement over and over again
Loop
o
o
o
DO…LOOP
Display the value of IN3 in the Debug Terminal
If the value of IN3 is 1, Then
Else, (if the value of IN3 is 0)
IF…THEN…ELSE
ELSE
ELSE
and
statement is reached, at which point the program skips to the
Turn the LED on
Wait for 1/20 of a second
Turn the LED off
Wait for 1/20 of a second
do nothing, but wait for the same amount of time it would have
taken to briefly flash the LED (1/10 of a second).
statement are executed until the
DEBUG ? IN3
statement. When the condition after the
commands are the same. The
THEN
statement are executed. They will be
IF
ENDIF
is not true
is reached.
(IN3 = 0)
PAUSE 250
IF
is true
(IN3
, the
was

Related parts for 28123