27297 Parallax Inc, 27297 Datasheet - Page 41
27297
Manufacturer Part Number
27297
Description
KIT STAMPWORKS WITH BS2-IC
Manufacturer
Parallax Inc
Datasheet
1.27297.pdf
(230 pages)
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
- Current page: 41 of 230
- Download datasheet (3Mb)
humans) in terms of program functionality, and any design change would have been
more difficult to deal with.
The main program loop is handled with the DO-LOOP construct, and separate on-
and off-times are provided for flashing the LED. As with the pin configuration, we
can easily change the flash behavior by making a simple edit in the declarations
section. Since the LED has two states, having independent timing values for each
state gives us the greatest flexibility.
Taking it Further
Another advantage to direct use of output bits is that we can create code segments
like this:
Can you tell what’s happening here? Since Strobe is actually a bit variable (OUT0 in
this program), we can write any bit value to it – even a bit that’s part of another
variable. In the example above, BIT0 (the LSB) of cntr will be written to the LED
control pin through each iteration of the program loop.
configuration, this will cause the LED to light when the value of cntr is odd because
BIT0, which has a value of one, will be on when cntr is odd.
Q: Without changing the PAUSE 500 line, how could we make the LED flash at half
the current rate?
A: Write the value of cntr.BIT1 to the LED. Do you understand why this is?
DO
LOOP
When does one make the choice between DO-LOOP and GOTO Label? While both styles
are functionally equivalent, DO-LOOP provides the convenience of not having to define a
program label for the GOTO. The downside of DO-LOOP is that it can be difficult to follow
when very long sections of code are embedded within it – especially when indentation
guidelines are ignored.
While there is no hard and fast rule, a reasonable guideline is that about ten lines of code
or fewer are fine for DO-LOOP; longer sections are best used with GOTO Label.
Strobe = cntr.BIT0
PAUSE 500
cntr = cntr + 1
Using our active-high
Related parts for 27297
Image
Part Number
Description
Manufacturer
Datasheet
Request
R
Part Number:
Description:
Microcontroller Modules & Accessories DISCONTINUED BY PARALLAX
Manufacturer:
Parallax Inc
Part Number:
Description:
BOOK UNDERSTANDING SIGNALS
Manufacturer:
Parallax Inc
Datasheet:
Part Number:
Description:
COMPETITION RING FOR SUMOBOT
Manufacturer:
Parallax Inc
Datasheet:
Part Number:
Description:
TEXT INFRARED REMOTE FOR BOE-BOT
Manufacturer:
Parallax Inc
Datasheet:
Part Number:
Description:
BOARD EXPERIMENT+LCD NX-1000
Manufacturer:
Parallax Inc
Datasheet:
Part Number:
Description:
CONTROLLER 16SERVO MOTOR CONTROL
Manufacturer:
Parallax Inc
Datasheet:
Part Number:
Description:
BASIC STAMP LOGIC ANALYZER
Manufacturer:
Parallax Inc
Datasheet:
Part Number:
Description:
IC MCU 2K FLASH 50MHZ SO-18
Manufacturer:
Parallax Inc
Datasheet: