ScratchGPIO V6 Alpha Testing

This blog is to introduce new versions of ScratchGPIO that might contain bugs or work in a different way to the normal version – so don’t use it to demonstrate ScratchGPIO to a class full of new users as it might change at anytime and not work properly.

It installs in a separate folder and doesn’t interfere with other versions

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.

wget -O

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

sudo bash


V6 Alpha Launched

Version =  ‘v5.3.23’ # 28June2014 NunChuck import wrapped in try except

Version =  ‘v5.3.22’ # 28June2014 PiGlow/Motor interaction bug fixed

Version =  ‘v5.3.20’ # 26June2014 NunChuck code released

Version =  ‘v5.3.05’ # 15June2014 Event detection and Triggering changed around

Version =  ‘v5.3.00’ # 11June2014 Pin trigger broadcasts

Version =  ‘v5.2.12’ # 29May14 – Changes to PiRoCon/MicRoCon motors

Version =  ‘v5.2.08’ # 23May14 – Ultra Threading for Pi2Go

Version =  ‘v5.2.07’ # 19May14 – Pibrella MotorE..H added and all motors new PWM code

Version =  ‘v5.2.06’ # 19May14 – Better Motor PWM by switching PWM pins

17May14 – 5.2.01 Major change – use much lower freq for motor PWM to improve torque at low speeds

11May14 – 5.1.41 PiDie bug fix with power

25Apr154 5.1.25  make sure all GPIO pins are turned off on program exit

21Apr14: 5.1.19 Event Triggering fixed/improved and back in.  Faster info flow from handler to Scratch as well 🙂

20Apr14:  V.5.1.17  Eventr triggering removed temp. Fix I2C issue with using normal scratchgpio PiMatrix removed temp

15Apr14: V.5.1.13 Lots of bux fixes and ADS581 support re-added

11Apr14: V5.1.04 – Change Github branch

9Apr14: V5.1.03 – More bug fix on inputs and change MotorPiTx to use output1/2 input1/2

9Apr14: V5.1.01 – Bug fix new input handling and add support for RC timing psuedo analog input

8Apr14 Input handling changed to use event triggers so no input change should be missed.  Also Out1/Out2 added for MotorPiTx

6Apr14 RasPiBot2 Added. 26Mar14 HapPi Added


18 thoughts on “ScratchGPIO V6 Alpha Testing

  1. Hello,
    thanks a lot for your work ! I’m a french STEM teacher, and after playing with the arduino I tried the Rapsberry.
    First I tried it with the PiFace shield, it works fine. This is cool for domotic but when I tried to build a robot with it I had a problem : motor can’t roll back !
    So I bought a PiRoCon card, it’s just perfect ! And with ScratchGPIO it’s easier and I’m trying to show it to primary teacher.
    But your ScratchGPIOv4 doesn”t work with the PiRoCon, whereas the v3 works fine…

    I try to build (it’s just the very beginning) a wiki about my test to help teacher, newbies, use it with pupills :

    Thanks a lot !

      • Thanks…but I still have the same problem after installation : “./scratchgpio4/” not found… You have to write Exec=/home/pi/scratchgpio instead of Exec=./scratchgpio

        It seems the handlet doesn’t work…no initialisation of the PiRoCon…ScratchGPIO3 work perfectly.

        Thanks a lot.

      • I don’t understand why you have to change the Exec line – it is in excatly the same format as the scratchgpio3 shortcut which works for you 😦

        Can you re-download the latest version as I’ve found one bug that would stop it working on some systems.
        Can you try running from LX terminal
        cd /home/pi/scratchgpio4

        it should launch the handler in a window and then Scratch – you shoudl either see an error or eventually if will say Running


      • The Exec line on the v3 isn’t “./scratchgpio/…” but “/home/pi/….” ; I don’t remember if I changed something or if it’s the original one.
        Your script “works”, but it seems to never stop on the LX terminal…
        However, ScratchGPIO4 works fine with PiRoCon !!! Perfect !

        I now have to make documentation and test sonar…

        Thanks a lot !

    • You can use broadcasts red/amber/green on/off outpute-h on/off and recognises ina-d and switch. Also beepxxxx where xxxx is freq in kHz but it’s not HiFi 🙂

      • Having some problems. First off,I try your simple LED light-up example using pin 11 (by broadcasting pin11high). On ScratchGPIO v3 it works,the LED lights. On v4 though it doesn’t work.
        I’m also trying the following in v4:
        when [] clicked
        set AddOn to pibrella
        broadcast redon

        Nothing happens. Am I doing something wrong?

    • unfortunately, I don’t have a PiFace 😦

      My code was originally the PiFace code but I changed it to just simply control the GPIO pins and then I ended up adding support fro add-on boards in.

      Maybe one day the PiFace fairies will lend me one 🙂


  2. Simon,

    I’ve installed V6 as described above; however, upon running ScratchGPIO6alpha I don’t appear to have any control over the GPIO pins (this based on attempting to configuring a pin as output and subsequently issuing a broadcast to set the pin on). Looking at the pins at the command line (gpio readall) indicate that all pins are still set to input. The exact same steps in ScratchGPIO5 works as expected.

    Could the issue be related to the fact I’m running a B+?


    • Not sure what you mean by atempting to configure a pin as an output as just say pinx on will turn it on – no configuration is needed 🙂 Also no idea what gpio readall is/does 🙂 But anyway – I’ll power up my B+ and have a check – what pin are you trying to turn on?


  3. Working with Pin11. After firing up scratch V6 I would run the gpio utility (which is part of wiringPi) to look at pin status. It will tell you if pins are configured for input, output or both along with the current state of the pin.

    Anyway, part of the problem is I didn’t have smbus installed. Just figured out the location of the so I can start it up from the command line and see any errors. The script seems to be working ok until it hits pin 29. I’m getting the following output from the script:

    setting pin 29 to in with pull up
    error reading pin event 29
    The channel sent is invalid on a Raspberry Pi

    at which point it just grinds (loops) on pins 29 thru 40.

    Within Scratch I have crated a variable “Pin11” and can set it to 1 or 0 but there is no voltage change on pin11 itself. I also attempted to broadcast “Pin11high” and “Pin11low” with no luck.

    I’m also getting an exception thrown in thread Thread-1:
    it looks like it’s coming from line 310 of based on the Traceback. The exception ValueError is “The channel sent is invalid on a Raspberry Pi”


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