Visual Command Guide

This post is to hopefully document all the available broadcasts and variable usage that ScratchGPIO understands and responds to

DocPic

mapswitch

Extra Blocks for specific Hardware

Several add-on boards can be connected to a Pi and be automatically recognised and used

AnalogueDocsAnalog Input/Output based on 8591Chip

Any board containing this chip can be used to read 0-5V analogue voltages and to control one variable output

 

 

 

 

 

Scratch Variable “bug”

Although using variables is necessary once you start writing complex scripts, there is a “bug” or a “feature” (depending on yourpoint of view) in the way that Scratch sends out variable changes to any external programs.

If you say broadcast pin11On then Scratch will always send Pin11On out to any listening programs

But if you use a variable called Pin11 and say set Pin11 to On then it only sends this information out if the previous value of Pin11 variable was not On i.e. only changes are sent out

pindocThis code will not switch pin11 on the second time as the variable has not changed from its previous value.

One workaround is to use the green join block and broadcast any variables

joindoc

This method will ensure than any variable changes are always sent out