When the code drops through Pause until, the value of
sysMillis is incremented.
Author’s Note: At the time of this writing, I am
lobbying the BlocklyProp team to rename the Pause until
block to Wait until to prevent confusion with the standard
pause block. This block compiles to waitcnt() which (to
me) justifies the name change.
We don’t want to call the background function
directly because the code will be trapped in its infinite
loop. What we want to do is launch it into its own cog so
that it does, in fact, run in the background.
Drag a new processor block from the Control menu
onto the work space, and put it at the top. Open the
Functions menu and grab the run function “background”
block. Drag this into the new processor block.
There is something important to point out here: The
new processor block compiles down to cognew(). Hence,
it should only contain a single run function block. That
function can call other functions as required.
July 2017 15
■ FIGURE 4. Background
■ FIGURE 5. Modified
YOU DESIGN IT – WE MACHINE IT
FRONT PANEL DESIGNER NOW OFFERING UV PRINTING
;;; Manufacturing Custom Panels & Enclosures
;;Free CAD Software
;;No Minimum Order Requirements
;;Built in 5 Days