27297 Parallax Inc, 27297 Datasheet - Page 49

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
Taking it Further
Q: How could we modify the code to cause the LEDs to behave like airport runway
lights?
A: See below for one possible solution (Can you modify the loop to test at the top?)
Write Code like a Pro
In this experiment we use binary (%) notation quite frequently – this is a handy tool
when our programming editor (like the BASIC Stamp IDE) allows it. This bit of code,
for example:
… is far easier to
When dealing with binary inputs (e.g., buttons or switches) or outputs (e.g., a bank
of LEDs), use binary notation to help yourself (and others) “see” the operation of the
code.
Reset:
' -----[ Program Code ]------------------------------------------------
Main:
LEDsDirs = %11111111
LEDs = %00000001
DO
LOOP UNTIL (LEDs = %10000000)
GOTO Main
LOOP UNTIL (LEDs = %10000000)
LOOP UNTIL (LEDs = 128)
PAUSE DelayTm
LEDs = LEDs << 1
visualize
than:
' make LEDs outputs
' start with right LED on
' on-time for lit LED
' shift LED left
' test for last LED
' test for last LED
' test for last LED

Related parts for 27297