Autostart ScratchGPIO project

Sometimes it can be useful to make your Pi autorun something when it is switched on.

With ScratchGPIO, you can autorun a Scratch program (it doesn’t have to be one controlling the GPIO pins but ScratchGPIO is needed to make it autorun

There are 2 steps

Create Linux Script

Run LX Terminal

mkdir -p  /home/pi/.config/autostart

cd /home/pi/.config/autostart


then type in following

cd /home/pi/scratchgpio5
sudo python &
scratch “/home/pi/Documents/Scratch Projects/”

If using ScratchGPIO6Alpha then do this instead

cd /opt/scratchgpio6alpha
sudo python &
scratch “/home/pi/Documents/Scratch Projects/”
CTRL-X then Y to save

chmod +x

Create a Scratch Autostart script

Make the Scratch script include the following in its On Green Flag Event


Then press the Green Flag to set AutoStart to True and save it in /homepi/Documents/Scratch Projects as

Reboot your Pi and it should automatically run the Scratch file


2 thoughts on “Autostart ScratchGPIO project

  1. Don’t know what or if I am doing anything wrong – but can NOT get sGPIO6 to run with the RTK-003 board – also tried the ‘broadcast’ method for Pyonkee – but NoGo with sGPIO6 ; tested on both B and B+

    Used these comands to install GPIO6:

    wget -O

    sudo bash


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s