S3DGPIO : ScratchGPIO for Scratch 3 Desktop on Raspberry Pi


I’ve manage to add native ScratchGPIO blocks to Scratch 3 Desktop on the Pi. If you fancy trying it out (its liable to change so don’t start using it to make big projects or run courses)


You need to install Scratch 3 Desktop by adding it via the Pi menu Preferences > Recommended Software

Then move /usr/lib/scratch3/resources/app.asar to /usr/lib/scratch3/resources/app.orig (in case you want to return to standard setup)

 sudo mv /usr/lib/scratch3/resources/app.asar /usr/lib/scratch3/resources/app.orig 

and move it to /usr/lib/scratch3/resources/app.asar with it (I’ll automate these steps eventually)

Re-install ScratchGPIO using standard instructions and hopefully you’ll have new S3DGPIO Desktop icon

Launch S3DGPIO Desktop – click on extension icon at bottom right and scrolldown to find S3DGPIO – click it

You should now have at least 3 blocks command (Pin 11 off etc) , set x to y (AddOn to UnicornHAT or Motor11 to 50 etc) and read (equivalent to ScratchGPIO sensor values)

NB. No pins are set to default to inputs so do a command Config 7 In to set pin 7 as an input with a pull-up resistor selected

Like I say very alpha at moment so not for in-experienced users!

DEbug mode


Terminal 1

cd /opt/scratchgpio8

sudo python scratchgpio_handler8.py

Open terminal 2

cd /opt/scratchgpio8

sudo python S3GPIOServer.py


Launch Scratch 3 (not S3DGPIO – just plain one)

Try pin 11 on and see if message gets to each terminal



You may also like...

Leave a Reply

Your email address will not be published. Required fields are marked *