27220 Parallax Inc, 27220 Datasheet - Page 40

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
Reset:
' -----[ Program Code ]----------------------------------------------------
Main:
Behind the Scenes
The version of the LED blinker gets to the core of the hardware and works at a lower
level – a little more setup work, yes, but the result is a program with greater
readability, as well as flexibility for modification.
meaning of:
On reset, the LED control pin, called Strobe, is set to its off state by writing the
IsOff constant to it, and then the pin is made an output so that it can drive the
LED. This is one of those rare cases where the OUTPUT keyword is used; the reason
is that after this point, LED control will be by writing to a bit in the OUTS register.
This initialization section demonstrates the context-sensitivity of the PIN declaration.
In actual fact, these lines of code:
… are translated by the compiler to:
Note how the compiler intelligently substitutes OUT0 in the first line of code, and the
number 0 in the second. Of course, we could have written the code as the compiler
ultimately translates it. The difference is that Strobe is more meaningful (to us
Strobe = IsOff
OUTPUT Strobe
DO
LOOP
Strobe = IsOn
PAUSE FlashOn
Strobe = IsOff
PAUSE FlashOff
Strobe = IsOn
Strobe = IsOff
OUTPUT Strobe
OUT0 = 0
OUTPUT 0
' enable pin to drive LED
And there is no mistaking the

Related parts for 27220