ScratchGPIO – Introduction for Beginners

This post refers to an older version of ScratchGPIO
Please use the new Version 5

This post is being left here as some books refer to the older version

Scratch Controlling the GPIO Pins on a Raspberry Pi
Part 1 of 4
(Version 4 – 20 Feb 2014)

This post is intended to make it as Simple as Pi to get up and running and make your Raspberry Pi control some lights and small motors and to respond to switches and sensors. Minimum Requirements – a Raspberry Pi with Raspbian installed (a working internet connection is very handy but not required)  a breadboard, some Light Emitting Diodes (LEDs), some resistors and some wire connectors. Total cost £5-£10. Blue italics are extra information for those who like to understand things a bit more – Pink italics are for the more advanced users and  can be completely ignored by normal users.

How to get a Raspberry Pi to control the GPIO Pins using Scratch —————————————————————
Your Raspberry Pi needs to be connected to the internet to install the software but not needed to run ScratchGPIO. Copy the text below ( left click just before the s of sudo and drag right until all the text in the line as been selected) then right-click and select copy. Open up an LX Terminal window and select Edit and the Paste that into an LX Terminal window and run it to download the installer.

sudo wget -O

Once the installer has been downloaded then just type (or copy and paste the text below as before)

sudo bash

(If logged in as a different user to standard pi, then  type sudo bash yourusername) This will install all the necessary extra software and some simple examples. (If you do not have internet on your Pi then, put your SD card into a card reader and try using your browser to right-click and save the script direct to your SD card and then put it back into you Pi and run the second instruction) Connecting Components Up ———————————————————————

EXTREME care should be taken when connecting hardware to the GPIO pins. You can cause your Pi to die by connecting the wrong things together – only do this if your confident of your ability to follow instructions correctly 🙂

AT A MINIMUM – get a breadboard and use some female-male 0.1 leads (available from lots of on-line suppliers or your local Maplin shop) Check out GPIO pin guides to make sure you know what pins are what. Wire up Pin 1 (3.3V) to (at least) a 330ohm resistor – connect that resistor to the long lead of an LED and then connect other end of LED to Pin 6 (0V). It should light up. If it doesn’t try reversing your LED. Now move the lead from Pin 1 to Pin 11. Using ScratchGPIO Run the special Scratch icon (Scratch GPIO) on your desktop. (It is actually a completely normal version of Scratch, it just runs a little Python background program as well that handles communications between Scratch and the GPIO and automatically enables Scratch’s Remote Sensor Connections(RSC)) To test out control from Scratch, click on File then Open and then click on the My Projects button and select blink11 and click on OK. Once the project opens, just click on the OK to enable Remote Sensor Connections. To run the script just click on the Green Flag.

blink11Your LED should now blink on for 1 second and off for 2 seconds – see trouble shooting if this doesn’t happen.

What more can I do with Scratch and the GPIO
As it comes, you can control six pins as outputs (Pins 11,12,13,15,16 and 18) and treat all the rest as simple inputs (22,7,3,5,24,26,19,21,23,8 and 10) (GPIO pin numbers/ordering do not follow anything that makes sense to most people so you just have to go with the seemingly random numbering arrangement)

As you can see in the blink11 script , you can simply use a broadcast message telling Pins to go on or off (Up to 3.3V and down to 0V) The valid messages are pinson along with the corresponding pin off messages. pinsoff

You can also say allonoff And you can replace the word  on with high and replace off with low if you want to talk in pure logic levels.

You can combine message together to make a single broadcast so to turn Pin11 and Pin13 on and all others off you can sayjoined oroff11on13on

Alternatively you can use the pinpattern broadcast to achieve the same result e.g:bpinpattern2This will also set just pins 11 and 13 on.

Inputs To check an input, you should go into the Sensing block and click on the word “slider” at the bottom and you’ll notice that you have pins 22,7,3,5,24,26,19,21,23,8 and 10. inputs If you connect a switch to one of these pins (through a resistor don’t forget) to OV, then you can detect when the switch is open or closed. The inputs will normally read 1 and go to 0 when they are connected (through a resistor) to ground. Click on the checkbox next to pin7 and try it out.

Using variables instead of broadcasts
For more advanced Scratchers, you can use variables instead (or as well as broadcast messages) .

For example: create a global variable called pin11 To make pin11 go on or off  use vonoff On can be replaced with high or 1 and off can be replaced with low or 0 so that you can use whatever logic scheme you’d like.

vallonoffTo set all outputs to on or off use

To use a “bit-pattern” to set/unset multiple outputs simultaneously usevpp (this will set Pin 11 , Pin 13,  Pin 16  and Pin 18 on and Pins 12 and 15  off)

vbug3Note – currently there is an unfortunate “bug” in Scratch in that it remembers variable states and only sends changes out.    Even when you press the Green Flag, it will not send the state of all the variables out, it will only send them when a variable changes. I recommend (nay insist even!) setting any gpio variables to an invalid value – say a full-stop and then to their initial state in a Green Flag start-up script.

Need more Pins as outputs?
If you need more than 6 pins to be outputs  then, for example, you can use broadcast pin7on and pin7 will change from an input to an output.

If for some reason,  you need more input pins you can use broadcast config11in to change pin 11 from an output to an input

Further documentation

Part 2 – using Motors and varying brightness of LEDs


To test if the software necessary to control the GPIO is correctly installed open a LXTerminal session and type

sudo python

If this doesn’t give an error but doesn’t make a LED on Pin 11 blink then we have real problems Houston 😦 Try connecting the lead going to Pin 11 back to Pin 1 to make sure the LED lights up then just in case you have a loose connection.

242 thoughts on “ScratchGPIO – Introduction for Beginners

    • The download link wouldn’t work properly using github as source so I’ve gone back to using dropbox so you may have to try again if you were quick off the block

  1. To use a “bit-pattern” to set/unset multiple outputs simultaneously use
    set pinpattern is this confused documentation or me being thick?
    Anyway it does not work on my new install.

    Everything else seems fine, no response from pinpattern.

    Also it appears not to initialize – sometimes, there has to be a ‘sequence’ (not worked out what yet, before the commands spring to life )

    • Aah – yes – 🙂 I forgot I removed it and I haven’t put it back yet! I’ll get onto it 🙂 But what do you mean about it not initilising – if you mean using variables – note the Scratch “bug” in that it won’t re-send a variable value if it hasn’t changed – even on a Green Flag event 😦 Thats why you have to use dummy values, wait a bit and then set initial values in Green Flag startup code..

  2. Sorry Simon,
    its me again: cp: cannot stat `’: No such file or directory
    Running the new install fails to copy the above file, no sign of it!
    I’ve tried a number of times – same result – what am I doing wrong?

  3. Simon,
    trapped the error messages:
    tar: Skipping to next header

    gzip: stdin: invalid compressed data–crc error

    gzip: stdin: invalid compressed data–length error
    tar: Child returned status 1
    tar: Error is not recoverable: exiting now

    • Rebuit it – re-uploaded – works for me 🙂 (I was proably too trigger happy in copying it from RPi to PC for putting into Dropbox – sorry – please test again and let me know yes or know and then I change to beta state 🙂

    • Hopefully OK now – its work for me anyway 🙂 I was probably not careful enough in copying from RPi into my dropbox! Please test – if it works then I’ll announce it as beta 🙂 Thanks for testing 🙂

  4. Thanks for this wonderful work. I started to use it to automate an old train circuit for my grand sons. Unfortunately I need more output pins (for traffic lights and points) and less input pins; is it possible to change usage of specific pins ?

    • Yes – i Haven’t documented it yet as I still might change how its done but at the moment if you broadcast config22out then that will change Pin22 to being an output – it should work for all pins 🙂

      • I am not familiar with the broadcast method as I am using variables which work perfectly but I will try it.
        I suppose it could also be done by modification of PIN_USE in
        The first elements of my application using output pins are working. No bug in that part. I will check input pins next week.
        Thanks for help.

  5. Hello,

    How does one actually get the sensor to work within a loop? i.e. I want to play a sound if the button at pin 22 is pressed and unable to do so. The slider does not seem to connect to anything like an if block. Please advise


    • So what you do is put a green compare block inside the if whitepsace and then add the pin22 sensor block into one side of the green compare block (if that makes sense?)
      So in your case you end up with something like
      if Pin22 sensor value = 0
      would then execute the instructions inside the block when pin22 is connected (thru a resistor of course) to ground)


      • when I launch ScratchGPIO2, right off the bat, process squeakvm takes > 20% CPU. Once I play sound a couple times, that number seems to shoot up to over 50% and the host becomes unresponsive. Wonder what is hogging so much CPU

      • Carry on spamming 🙂
        Well we all think the variable display issue is fixed so there should be no need to hide it1
        Can you post a link to a script that is causing these issues please?
        Can you change the script so that it waits for a keypress and just run it from normal Scratch launch icon so it doesn’t use my code (need to reboot first to make sure my handler isn’t running idly in the background)


      • I dont really have a script. Its just a scratch project connected to input buttons via GPIO pins. I am running the version of ScratchGPIO2 from this website. Thanks much.

      • Scratch is still very unstable on the pi. Just clicking on the Sounds tab on the project seems to cause the CPU to spike to over 80% and immediately drops down when I click out of it (i.e. when I go to the scripts tab). Playing sound a couple times makes the host die. Anyone else running into this problem?

      • It fails for me as well (I don’t normally use sound so I never noticed!)
        I think we should go back to the forum as it fails on me without using my GPIO software so its a general Scratch/RPI issue 🙂


      • Hi again,

        I installed Occidentalis v0.2 after reading a few posts on overall stability. So far playing sound on scratch it has not crashed (The CPU still jumps tho). However, when using your scratch wrapper, I dont see all the pins in the slider control (basically everything below “distance” is missing. Any ideas what may be happening? I know the inputs are connected OK because I can read the values directly via gpio command line. Thanks a lot

      • I’ve not used occidentals and don’t intend to try it – life is hard enough trying to get everthing orking OK on Raspbian 🙂

        The sound problem is/was a Raspbian issue. I updated to the latest (See ) version and now the sound is working again

        If you have to remove code, then occidentals does not have latest RPi.GPIO package installed 🙂

        I recommend putting Raspbian back in, update it and remove the sound .conf file and test again 🙂

        It now works fine for me 🙂


      • OK – fixed it 😉 I ran by hand and found that it fails due to

        Traceback (most recent call last):
        File “/home/pi/simplesi_scratch_handler/”, line 18, in
        AttributeError: ‘module’ object has no attribute ‘setwarnings’


        Traceback (most recent call last):
        File “/home/pi/simplesi_scratch_handler/”, line 19, in
        AttributeError: ‘module’ object has no attribute ‘cleanup’

        I commented out those 2 lines (possibly old version of module installed with my distro) and it seems to run fine. not sure if it has other side effects

      • Yes – I did remove sound.conf. Things appeared to work fine for small wav files but raspbian continues to crash for larger files. Occidentalis does appear to be stable in comparison so far.

      • But occidentals sound like its ancient (:) ) so you are just being lucky 🙂 We need to find out cause of crashes on latest Raspbian so everyone can benefit 🙂 Can you upload a sound file that crashes on yoru updated Raspbian setup?

        PS is my old software BTW 🙂


      • Ok – lets try again 🙂
        Raspbian is being constantly developed – the sound used to have a problem – it was fixed – then somewhere along the way a bug was introduced – it has now been fixed again – going back to an old version that worked is not the way to progress and intruduces other problems such as the RPi.GPIO errors you got 🙂


    • I need 4 input pins connected to buttons for my project – I see that pins 22 and 7 work perfectly but pins 3, and 5 always seem to be in an “on” state. Any reason why those two behave differently? Is there a simple way to turn one of the output pins (say 16 or 18) into input pins? Thanks very much for your program!

      • Yes – Pins 3 and 5 have pull-up resistors conencted to them on board the RPi so they will naturally read high unless connected to ground.

        Only 11,12,13,15,16 and 18 are defaulted to ouputs – all the rest are inputs so you can choose your other two from 24,26,19,21,23,8 and 10.

        You can use Broadcast config16in if you want – I didn’t document it as I didn’t think anyone would need more than 9 inputs 🙂

        PS can you post a link to a large sound file that is causing you problems so I can test please 🙂

  6. It’s not working for me in Scratch, although if I follow the troubleshooting instructions the LED does blink without error. What should I check next to get scratch working? Thanks.

    • Well lets try a few things – did you do both stages of the install process? Did the second stage seem to give a sucessful outcome e.g something very similarr to this
      sudo /boot/
      Self Extracting Installer

      Running Installer

      Install Details:
      Home Directory: /home/pi
      User: pi
      Group: pi



    • I had exactly the same problem – turned out that I had an old version of python-rpi.gpio installed (0.2.0-py2.7). I corrected the problem with the following :

      {to try remove the installed version of python-rpi.gpio using apt-get}
      >> sudo apt-get remove python-rpi.gpio

      {… to search the file system for other installed versions}
      >> find /usr | grep python | grep -i gpio

      {the response I got was:
      {Note that I had a mix of python-rpi.gpio versions – uptodate for python3, OLD for python2.7!}

      {… to manually remove the old python2.7 rpi.gpio directories – check you have the correct name for your directories}
      >> sudo rm -r /usr/local/lib/python2.7/dist-packages/RPi.GPIO-0.2.0-py2.7.egg/

      {You can check they have been removed by issuing the “find /usr | grep python | grep -i gpio” command again}

      {… to install the new software version – using apt-get}
      >> sudo apt-get install python-rpi.gpio

      {If I issue the “find /usr | grep python | grep -i gpio” command one final time I get the following response:
      …. I hope this helps…



  7. Hello Simon,
    Do you intend to have a version of Scratch GPIO using the new version V2.0 of Scratch which has been released a few days ago ?
    Thanks in advance.

  8. Hello Simon.
    I am very new at this, and I cannot get past the first step.
    When I try to download the installer, I get this message:
    “The certificate of is not trusted. The certificate has not yet been activated.”
    Do you know what I need to do to get it working?
    Thanks so much.

  9. Never mind. I’m all set.
    I was able to copy the file to the desktop and run it from there.

    • Phew 🙂 Never seen that sort of error msg before – maybe dropbox was being strange at the time 🙂
      Glad you’ve got it going – any questions – just pop back 🙂


  10. Hello,
    Can you tell me if there is any chance to simulate i2c with gpio in scratch and maybe you already tried this?

  11. Found your site and am very excited to try this with some kids next year. I played with Lego Mindstorms a bit, but too costly for now. Raspberry should come in a few days. Hopefully I can get it all working well. I don’t have all the parts you do (I’m VERY new to linux and all this stuff).
    Only thing I’ve done is program in VB a bit (simple) and play around with scratch. So no idea about most of this stuff.

    I was wondering If you post a parts list of your robot I would love to create one for my class to program and play around with.

      • An electrical components list would be a great start =). I’m wondering what to buy (buying alot from ebay and takes weeks to come). I ordered a lot already.

        I was wondering if DC motors are as easy to control as well? Will they still use Motor A (128) or will it be different. I am thinking of buying a kit from sparkfly just to make it simple for now (contains wheels and some gear motors) might not be that fast, but I can improve it as I play around I hope. They are DC motors though. I assume I will need some kind of chip to control them. Do you know which ones?

  12. I gave up buying individual bits and pieces for motor drivers, instead used Ebay!

    Dual H Bridge DC Stepper Motor Drive Controller Board Module Arduino L298N #236
    Item Number 140743762410 £3.41

    DC 5V Stepper Step Motor+Driver Test Module Board ULN2003 5 Line 4 Phase Arduino
    Item Number 310557450907 £1.72
    Magician Robot Chassis from Cool Components £11.14

  13. HI Simon,

    I am working on an interesting project which is right up your street and very much in line with your great work on RPi GPIO handling through Scratch. I would really like to tell you more about it, would you mind giving me your email address or a way to privately message you in this forum so I can introduce myself ?

    Kind regards,


  14. Hi. This is fantastic – thanks for sharing. I just got the led blink working in Scratch with my Gertboard. For anyone else trying this, the pin-out on the Gertboard doesn’t match the setup in Scratch. I changed the GPIO setmode in the python script to BCM and that seems to have worked.

    • is it hard to use i2c with this script? I thought the script was limited to only the gpio pins available (without editing the script of course)

      • after looking into the script a bit more. Is this correct? You can do the I2C and extensions and they will just have new ‘pin’ names. e.g. motor88 would do gpio88 (technically). But what are the new pin names if you do add more.

      • I just thought of an idea too. If you do a mesh. You could technically just have 1 pi connected to various other things and allow students to just send broadcasts to their (pins) to play around with the idea of interfacing with the real world. of course you would need addition power.

      • I’ve not implemented any I2C handling (as I’ve no I2C devices or boards 🙂 ) It’ll get done one day but not a high priority for me 🙂

    • The current version doesn’t support using BCM GPIO numbering but I’ll try and add it back in again for the experts out there 🙂

  15. This doesen’t seem to be working for me. I kow this seems strange, but using the blink11 example the LED doesn’t blink. Why? Everything is wired properly, the LED /is/ actually connected to pin 11, but why won’t it work?

    • Forget that, I was using the numbers normally used in Python. (Where the actual pin 11 is 17) I guess I’m just too dunderheaded to look at the diagram.

      • Its not a case of being dum, its just the problem that we’ve all got with the numbering systems – a lot of engineers want to use GPIO numbers but the rest of us prefer physical pin numbers as we can simply count along and get the right one 🙂

  16. I wish to understand how is put together and how you made Scratch be able to connect to the GPIO pins. What code is there in the background to make it all work ?

    • Basically there is one Python program that gets called to run before Scratch is launched. The Python programme listens to Scratch broadcasts and variable updates using the Remote Sensor Connection feature of Scratch. So the Python progrram is the one really controlling the GPIO pins

  17. Hi, the installation instructions dont work, when I type sudo /boot/ on the LXTerminal I get not found or syntax error = ‘(‘ unexpected.
    I tried saving it to another folder and running it from there and I get ‘sudo /boot/ command not found’
    What am I doing wrong? can you advice

    • Hi omar – your the 1st to say the intructions don’t work! Are you doing the 1st bit which downloads the to your /boot folder – is it coming up with some sort of error?


  18. I have the same problem as prawntot. Running from command line does just what I’d expect however using Scratch project blink11 there is no joy. I have installed Debian Wheezy 2013-05-29 then ran apt-get update, upgrade then followed the instructions from cymplecy on this page. Nothing else was done with this distro. Was able to confirm that self extracting installer did give a successful outcome in regards to terminal output ending in “finished.” About scratch indicates that it is v1.4. Any thoughts on how I could trouble shoot this further?
    thanks, Nick

    • More info. I have rpi.gpio-0.3 installed and when running apt-get install python-rpi.gpio, I am informed that this is the latest version. Thanks for any pointers, Nick

      • Problem solved, I had inadvertently used 2013-05-29-wheezy-armel for a distro. Duh! Thanks for putting this together Simon. I will be hosting a workshop with some high school next week with pis and your scratch gpio in the US.

  19. desperately looking for help!

    I already downloaded the I can see it when I input the command “ls” however, I cannot install it with the following command:

    sudo /boot/

    The Pi says command not found

    What am I doing wrong?

  20. Hi,
    Is there any way of controlling servos or motors through this without using additional hardware?

  21. HI there, is there a way of getting Scratch to send out i2c commands? I’ve got a WS2801 LED breakout board.. would like to broadcast messages out to it… can it be done?

    • Yep, the new version supports the PiGlow which is an I2C board so I’ve got the basic code base in place. Email me to discuss how we can add in your device simplecy at

  22. I have had my Raspberry Pi a week and really appreciate your tutorials and work. I got the blink project to work not problem. But now I wanted to turn the light on and off with a button. However, I cannot get Scratch to respond to a GPIO button press. It works in python so I think I have it wired correctly.

    Here is the Scratch Project

    When [flag] clicked
    If pin24 sensor value = 1
    Broadcast pin11low
    Broadcast pin11high

    In the presentation window I have the sensor value visible.
    The initial value of pin24 is 1 so no light shown. I see no change in value when the button is pressed.

    Any help would be appreciated.

    Thanks, Todd

    • Hi Todd, I’m away from computer today so I’ll look at this when I get home to see if I’ve mucked up my code during recent changes. Can you post your python code that works for me please, regards Simon

      • Thanks for the help.
        Below is the website where I got the code and the code.

        import time
        #initialise a previous input variable to 0 (assume button not pressed last)

        import RPi.GPIO as GPIO

        input = GPIO.input(24)

        prev_input = 0
        while True:
        #take a reading
        input = GPIO.input(24)
        #if the last reading was low and this one high, print
        if ((not prev_input) and input):
        print(“Button pressed”)
        #update previous input
        prev_input = input
        #slight pause to debounce

      • Hi – your Python code is using the native BCM numbering scheme whereas I use physical pins numbers for Scratch – BCM24 is equivalent to physical pin 18 – try using 18 in your Scratch code 🙂


  23. That worked. THANKS for your help!! I moved my button to pin 7 and it worked. Spent a lot of time on something simple. But, I will not make that mistake again. Todd

  24. Hi, Awesome work, looking forward to letting some students loose with it next Thursday for a school club, but I’m having one minor problem, broadcast works a treat to change pins, but the variables aren’t (well, they work on 1 of the Pi’s, but not the other). I’ve played around in the code and discovered that if I print out dataraw on the line with “Received from scratch-Length:” I get Data: sensor-update “pin16” 0 “pin22″ 0
    However, if I print dataraw here

    if len(dataraw) > 0:
    dataraw = ‘ ‘.join([item.replace(‘ ‘,”) for item in shlex.split(dataraw)])
    #print dataraw

    I end up with the
    sensor-update pin16 0 pin22 0

    I’ve changed the code that searches for the string later on when performing the sensor-update, and with the changes (removing the ” )it works….

    It appears the shlex.split also removes the “, and hence breaking the searches later on!

    A simple test program I tried on the console showed this too
    import shlex
    print shlex.split(“Hello \”World\””)

    Hopefully that will help.

    • Ta – I added the dataraw = ‘ ‘.join([item.replace(‘ ‘,”) for item in shlex.split(dataraw)]) to sanitise variation in variable names/values (e.g putting a space between pin and 11 or mistakingly adding a space in a variable value! )

      I’ve realsied that I only used new structure for the new MotorPITx and PiGlow code and didn’t go back and make sure mu core stuff still worked OK 🙂

      I’ll get onto it right away 🙂


    • Bug fix for ScratchGPIO – updated to V2.821 – using variable to control pins should be back to working again – please let me know if anything else doesn’t work :0


  25. I’m sorry but I’m stuck on the first step. I’m getting ERROR 403: FORBIDDEN when trying to download it.
    Anybody have any advise, many thanks.

    • mm – I’ve just tried the download myself and it worked OK – maybe you just tried while I was in the middle of uploading the 2.821 version earlier – I suggest trying again and seeing if you get better luck


  26. My name is Mikado7 and I am very new to the Pi and to Linux so starting with scratch seems the right way for me. (I am a very senior citizen with experience only of Sinclair and BBC micro computers and PCs)
    I am trying to get my 8 & 12 year old grandsons into computing, as I did with my own children through the BBC micro.

    Firstly I would like to say a big thank you for your program for accessing the GPIO from Scratch. You have obviously put in a great deal of work and yet your patience with questions that have already been answered in the discussions, is amazing. I have learnt a great deal already from your “Introduction for beginners” and the discussions following them.
    I would like to say that the download and operation of the blinking LEDs worked first time for me and I am ready to try motors when I get the ULN2003 chip.
    I am interested to know what part 4 is about as I can’t seem to find a link to it.
    I have clicked on “Follow” which I hope will keep me up to date on future projects, but are there any in the past that would be helpful? It is a great pity that you are not a teacher in our village primary school!
    Thanks again for all your work and help for me.


  27. Nice work Simon, thanks. Your guide was very easy to follow. When downloaded the Scratch GPIO I found I did not have a suitable cable to connect the LED to gpio. Well, a old data cable from a HD drive came in my help. Then I  can to see my LED blinking. Thanks again, and sorry for my limited english skills.

    • The Piface is a great device and in fact this code was developed from their original software – ScratchGPIO is for those of us on a very tight budget 🙂 I believe Tom Preston the original authour os now incorporating some of my additions into the PiFace code so the great circle of open-source life will be going around once more 🙂


    • Well thats normally an indication that the download has failed. Can you run the 1st bit again and look at the gobbly gook and see if its worked – copy ans paste it here if possible

      PS I foudn out today that if i double-clicked on the line of code it selects it all which I’ve found is easier than trying to select the code by click and dragging.

      (I wish I could come up with a easier way of getting it installed though!)


      • This is a copy of the download : –

        julian@GridCamera:/boot$ sudo wget -O /boot/
        –2013-08-28 20:46:07–
        Resolving (…
        Connecting to (||:443… connected.
        HTTP request sent, awaiting response… 302 FOUND
        Location: [following]
        –2013-08-28 20:46:16–
        Resolving (…
        Connecting to (||:443… connected.
        HTTP request sent, awaiting response… 200 OK
        Length: 139488 (136K) [text/x-sh]
        Saving to: `/boot/’

        100%[===============================================================================================================================================>] 139,488 133K/s in 1.0s

        2013-08-28 20:46:43 (133 KB/s) – `/boot/’ saved [139488/139488]

        and this a nano of the file :-

        echo “”
        echo “Self Extracting Installer”
        echo “”

        export TMPDIR=`mktemp -d /tmp/selfextract.XXXXXX`

        ARCHIVE=`awk ‘/^__ARCHIVE_BELOW__/ {print NR + 1; exit 0; }’ $0`

        tail -n+$ARCHIVE $0 | tar xzv -C $TMPDIR

        cd $TMPDIR
        ./ $1

        cd $CDIR
        rm -rf $TMPDIR

        exit 0

        K^]�yq,�7�Y�2� ��^Ã
        L0^P� ^H�8*A^T+��^LbpU�����Jg���F�|Ô0k`�f|�^F^C^GI���k4Zx^A���^@Ѭ@.^^OĬ�^QEoЬpH@�9̬^L)Z-�h^AI�Gd^H^DO^\OȬz-"��ͬ!d��3�2ï^D�U^\�"]�^A ^C�Z�g�8�*s^L��^D-^\J�A����8(ܬ ,7Ǭ^@��ӠӠ@�Ơߠ^_Ï ^X�,7��&c �^Q�,^ES^A^\^\Ç A&^D�Ҡ͠4^�^DӼɼe�.�Ӽ&ͼ^S�Y�d�^^X�QXƼ�^]^@Z^V^Q�D^DI2�^X^Q)�^\�X^P�^@^Sb�2,^RK:FD`z�^R^X+�22c�^T5^H^RB��]�P^K5″^DJ�ÄJ��+C”�J\�q×6��^Y&��^H^G��×BB$|ÒR]^H�Z”^D�hx�0ï���1Q�Z^_@^P�^[ n^W�$^D^X�-D^D��=�\^���)R%^Vs�I�H^NL:L^]�hM�Y��^W�(^V!�u���&@��^U���A�q^X-GMÄ�m#�F���^\��8�ï¿C�P�{�’1�^\��:�|���^[^T�b}^N�^Hj���6��^ZEÞ�j���bÐÎ]�d��eÆ��!�^Mq��5�^Ã
        �HqO�”��I�^Z#���ȵ^W^S^^RƵ^A^YAr�i��x%����$��B µ^Nj�Ð�+�o^G�^V �qJD-�X ^B
        a��G^N^L�Ø&^Q*)^Yt�Q(i�Tn�^��Ê]�^ÃK��$�N^Gh�i^R�ÎGh��^TB�A^S&I^Dz��^P��ß���XTÃ�7t^BÖ�_Ü(}^AH^G-Ã�� Ú<�Ia�vŽ�I�ʽÕo^R�^N�]��U�^\���5��^B�A�^X}� ^B�U��� *��ʾ

        Really want to play with my son and and I are converting a Big Trak to run on pi and I would like to use scratch for diagnostics and to program it .

        our rocket launcher lol we done the weapons first .

      • Well – it looks like its downloaded OK so I’m pretty much at a loss as to why its not appearing in /boot 😦

        Can you go into /boot and do an ls?


  28. done and the starnge thing is the file is there. I will try a fresh install tomorrow just in case becasue my webiopi has stopped working too . Will post back if it works or not. Thanks for the fast responce would not get this level of support from microsoft lol.

  29. Hi,

    A bit of a problem on Occidentalis v0.2. Running “sudo python” works just fine, but neither one method from ScratchGPIO2 (broadcast, set, pin…) turns on the LED.
    Ideas? 🙂

    • Sorry – I’ve got no idea what occiendetalls 0.2 is?? Its just intended to be run under normal, up to date Raspbian I’m afraid 😦

      It assumes a particular directory structure that might not exist with your setup. 😦


  30. Still the “sudo python” exits with “‘module’ object has no attribute ‘setwarnings’”.

      • pi@raspi ~/simplesi_scratch_handler $ sudo python
        Traceback (most recent call last):
        File “”, line 26, in
        AttributeError: ‘module’ object has no attribute ‘setwarnings’

  31. I tried running this:
    import RPi.GPIO as GPIO
    and got:
    AttributeError: ‘module’ object has no attribute ‘RPI_REVISION’

    Since the RPI_REVISION is not available, it seems (according to info on that my Rev2 Pi is supported only in RPi.GPIO 0.4.0a or newer:
    – Added support for Revision 2 boards
    – Added RPI_REVISION

    I’ll upgrade to newer module and try again 🙂

  32. Hi,

    Thanks for the work, but … it does not work.

    First of all, he line “sudo wget …” does not work. I get the answer “no such type of file or directory”.
    I succeeded in downloading the file and then copying it in /boot and installed it.
    I got the “ScratchGPIO2” icon. The program launches, I have the example files, but nothing works. No effect on the gpio pins.
    When I look for the sensors, no pin is visible. I have only 9 choices, with no pin.

    And when I try “sudo python”, I get “command not found”.

    Directory /home/user/simplesi_scratch_handler is present and contains two files, “” and “”
    Python 2.7.3 is installed.

    What is missing ?
    Thank you for help.

    • First of all, he line “sudo wget …” does not work. I get the answer “no such type of file or directory”.
      I succeeded in downloading the file and then copying it in /boot and installed it.

      It is a bit tricky to copy and paste the text but if you can get it all it does work – honest 🙂
      But if you managed it another way great 🙂

  33. Sorry update :

    I succeeded in making “” work with LED blinking, but still nothing from blink11 in “scratchGPIO2”.

    • Yes, your very kind, but I allready tried “sudo apt-get install python-rpi.gpio” and got the answer : “you have the latest version”.

      Another idea ?
      (note my board is rev 1)


    • Hi, Just a quickie I hope. I have managed to get your “2 motors working in Scratch with PWM” but as Inow want to operate remoteley using my laptop I guess I will have to do it in Debian. Please can you advise me how to do this or point me to an article describing how to do it. One other thing, how many GPIO pins can provide PWM? Many thanks for your help in the past. tubluv

      • I use x11vnc on all my RPi to remotely use them using tightvnc on my PCs/laptops
        I use this to setup my RPi x11vnc

        I am developing a different way of working called SID (Scratch Interface Device) which means you can run Scratch on your main computer and just have the GPIO handler running on your RPi but its not fully developed yet (Too much to do – too little time to do it in)


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 )

Google photo

You are commenting using your Google 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