27220 Parallax Inc, 27220 Datasheet - Page 221

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
Power PBASIC · Page 211
Power PBASIC
Before I close, I’d like to share a few things that I think separate Power PBASIC
programmers from the rest of the field. Simple things, really, yet highly effective
and, sadly, usually underutilized. It’s up to you to master or adopt these strategies,
but I think that if you do you will be rewarded for your efforts.
Adopt “The Elements of PBASIC Style”
I know I harp on about this, and I do it for a very good reason: in the 12 years I’ve
been writing programs for BASIC Stamp microcontrollers I find that most
programmers create bugs through sloppy programming practice.
Adopt the
neatness counts
philosophy that
and your programs will have fewer bugs – I know
this from experience.
Be Stingy with Variable Declarations
Many programmers, especially those born after the invention of the personal
computer, have learned programming on platforms with resources far greater than
that of the BASIC Stamp microcontroller, and along the way have never really
worried about managing variable space. These programmers usually don’t take very
long to find that techniques used in their PC programs don’t fly on the BASIC Stamp
(or other small micros).
Analyze your programs and declare variable type as required by the code.
If a
variable has an upper limit of 10, use a Nib, not a Byte or Word as this would simply
be wasting variable space.
Arrays are Implicit – Take Advantage
A question that frequently comes up is, “How can I alias an element of an array?”
The answer is: you can’t – at least when you declare an array like this:
colors
VAR
Byte(3)

Related parts for 27220