27220 Parallax Inc, 27220 Datasheet - Page 49

BOOK STAMPWORKS

27220

Manufacturer Part Number
27220
Description
BOOK STAMPWORKS
Manufacturer
Parallax Inc
Datasheet

Specifications of 27220

Accessory Type
Booklet
Product
Microcontroller Accessories
Lead Free Status / RoHS Status
Not applicable / Not applicable
For Use With/related Products
StampWorks
Lead Free Status / RoHS Status
Lead free / RoHS Compliant, Not applicable / Not applicable
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 27220