28123 Parallax Inc, 28123 Datasheet - Page 87

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
the number 1, and when the pushbutton is not pressed, the Debug Terminal displays the
number 0.
' What's a Microcontroller - ReadPushbuttonState.bs2
' Check and send pushbutton state to Debug Terminal every 1/4 second.
' {$STAMP BS2}
' {$PBASIC 2.5}
DO
LOOP
How ReadPushbuttonState.bs2 Works
The
250
IN3
instant the
DEBUG ? IN3
PAUSE 250
. Each time through the
to the Debug Terminal. The value of
DO…LOOP
Enter the ReadPushbuttonState.bs2 program into the BASIC Stamp Editor.
Run the program.
Verify that the Debug Terminal displays the value 0 when the pushbutton is
not pressed.
Verify that the Debug Terminal displays the value 1 when the pushbutton is
pressed and held.
DEBUG
in the program repeats every ¼ second because of the command
command is executed.
DO…LOOP
, the command
IN3
is the state that I/O pin P3 senses at the
Figure 3-8
Debug Terminal
Displaying
Pushbutton States
The Debug Terminal
displays 1 when the
pushbutton is pressed
and 0 when it is not
pressed.
DEBUG ? IN3
sends the value of
PAUSE

Related parts for 28123