27297 Parallax Inc, 27297 Datasheet - Page 44

KIT STAMPWORKS WITH BS2-IC

27297

Manufacturer Part Number
27297
Description
KIT STAMPWORKS WITH BS2-IC
Manufacturer
Parallax Inc
Datasheet

Specifications of 27297

Lead Free Status
Contains lead
Product
Microcontroller Accessories
Lead Free Status / Rohs Status
Lead free / RoHS Compliant

Available stocks

Company
Part Number
Manufacturer
Quantity
Price
Part Number:
27297SQ
Manufacturer:
NS
Quantity:
4
Program: SW21-EX03-Counter_LEDs.BS2:
' {$STAMP BS2}
' {$PBASIC 2.5}
' -----[ Program Description ]---------------------------------------------
'
' Displays a 4-bit binary counter on LEDs connected to P0 - P3.
' program will work, unmodified, on any BS2-family module.
' -----[ I/O Definitions ]-------------------------------------------------
LEDs
LEDsDirs
' -----[ Constants ]-------------------------------------------------------
MinCount
MaxCount
DelayTm
' -----[ Variables ]-------------------------------------------------------
cntr
' -----[ Initialization ]--------------------------------------------------
Reset:
' -----[ Program Code ]----------------------------------------------------
Main:
LEDsDirs = %1111
DO
LOOP
FOR cntr = MinCount TO MaxCount
NEXT
LEDs = cntr
PAUSE DelayTm
VAR
VAR
CON
CON
CON
VAR
OUTA
DIRA
0
15
100
Nib
' LEDs on P0 - P3
' DIRS control for LEDs
' counter start value
' counter end value
' delay time for LEDs
' 4-bit counter variable
' make LEDs outputs
' loop through all values
' move count to LEDs
' hold a bit
' repeat forever
This

Related parts for 27297