28123 Parallax Inc, 28123 Datasheet - Page 90

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
Programming Pushbutton Control
The BASIC Stamp can be programmed to make decisions using an
statement. The example program you are about to run will flash the LED on and off
when the pushbutton is pressed using an
the
decides whether or not to flash the LED.
Example Program: PushbuttonControlledLed.bs2
' What's a Microcontroller - PushbuttonControlledLed.bs2
' Check pushbutton state 10 times per second and blink LED when pressed.
' {$STAMP BS2}
' {$PBASIC 2.5}
DO
P14
P3
DO…LOOP
Build the circuit shown in Figure 3-11.
220
Enter PushbuttonControlledLed.bs2 into the BASIC Stamp Editor and run it.
Verify that the LED flashes on and off while the pushbutton is pressed and
held down.
Verify that the LED does not flash when the pushbutton is not pressed down.
470
, the
Vss
Vss
IF…THEN…ELSE
10
kΩ
LED
Vdd
statement checks the state of the pushbutton and
P15
P14
P13
P12
P11
P10
P9
P8
P7
P6
P5
P4
P3
P2
P1
P0
X2
X3
IF…THEN…ELSE
Vdd
Vin
+
Vss
statement. Each time through
Figure 3-11
Pushbutton and
LED Circuit
IF…THEN…ELSE

Related parts for 28123