16 July 2017
Okay, we have a background milliseconds timer. Let’s
put it to use. Figure 5 shows the modified master block
which takes advantage of the timer. Yes, I know this looks
somewhat complicated, and it is certainly more
sophisticated than the original example. What we gain
from the effort, however, is a lot of time that is no longer
wasted sitting in a pause block; valuable time we can use
to handle other processes.
Finally, I like to keep my master program loop tidy by
calling discrete atomic functions. I created a final blink
demo (sans terminal output) that will flash both LEDs on
the PAB. By removing the terminal output, the P26
flashing can be simplified to toggle. For the P27 LED, we
create an asymmetric flash by varying the state time based
on the LED condition. See Figures 6, 7, and 8.
I know that blinking LEDs is not as glamorous as
running a robot, but the framework we just put together
is excellent for robots and all sorts of other schedule-based processes.
Give BlocklyProp a try. If you’re new to the Propeller,
it’s a way to get started without the worry of syntax rules.
If you’re a crotchety old dude like me, it’s another tool to
help others and, perhaps, to look at code from a different
point of view.
Until next time, keep Spinning and winning with the
■ FIGURE 6. Clean main loop.
■ FIGURE 7. LED 26 function.
■ FIGURE 8. LED 27
$7.50 $29.95 $139.95
ent, olts, curr DMM - V
ransistor Resistance, T
est. and Diode T
Auto and manual
Runs on DC or AC
Equipment, of Electronic Source
face. d inter
and Components Tools,
Sweep Function Generator
m Functions, Int/Ext Counter avefor 3MHz, 6 W
Model FG- 30
Model FG- 32
972-2225 1 (800)
100MHz Rigol Oscilloscope
es: 1 million points of Featur
d ecor , r , FFT y deep memor
nate trigger mode, and oll mode, alter , r eplay and r
adjustable trigger sensitivity
USB version with Stamp and USB Cable.
Parallax Board of Education Full Kit
Siglent 50MHz DSO
32K M y emor
USB I t ace n er
e uency Cou 6 Di it Fr
een -LCD Scr 7” Color TFT
BOE Full Kit
Parallax 7.5V Power Supply
DC Power Supplies
ariable Output, 0-30VDC, V
Outputs plus 5V 3A fixed.
48W Soldering Station
( 5 digit display)
ariable o 0-30VDC, 0-3Amp V
olled p. Contr
Propeller boards, chips, and programming tools