BlocklyProp
BlocklyProp copied to clipboard
Block request: run as setup
@VonSzarvas pointed out an unfortunate side effect of having init block code always generate at the top of the main() function. He described it as so:
Sometimes I like to run little sensors direct from the FLiP pins. I've seen you enjoying that shortcut in the past also :) So we need to set the appropriate IO's for sensor VIN and GND to high and low BEFORE calling SPI init. But... The blockly code pushes the init block to the start of main(), so if you had used "make PIN blocks" and a pause, before the init, they get called only after the init :) The three blocks I used are in the attached blockly picture, but set to disabled so a little grey looking. When swapping to code view, those three blocks are pushed after the "Air Quality init" command...Is there a way to use "make PIN" blocks /etc... , and force them to stick at top of main? Maybe some sort of container block for setup instructions (like how the "do" block works, that other init commands cannot jump ahead of?