28122 Parallax Inc, 28122 Datasheet - Page 90

KIT WHAT'S A MICRO:PARTS ONLY

28122

Manufacturer Part Number
28122
Description
KIT WHAT'S A MICRO:PARTS ONLY
Manufacturer
Parallax Inc
Datasheet

Specifications of 28122

Accessory Type
Parts Kit
Product
Microcontroller Accessories
Core Processor
PIC16C57c
Flash
128 Bytes
Operating Supply Voltage
9 V
Board Size
31 mm x 16 mm
For Use With/related Products
Board of Education Full Kit
Lead Free Status / RoHS Status
Lead free / RoHS Compliant
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 28122