With the new 'jessie' Raspbian comes a new Scratch. There'll be more extensive documentation appearing soon but the two headline items are
a) speed; the VM & image is now a Squeak Cog/Spur system. This means roughly 5x faster execution of non-graphics operations; remember we sped up the graphics a while ago. Anyone for Asteroid Blaster at 150fps?
b) a new built-in gpio server. It doesn't replace the socket based broadcasting so all of Simon's and Gerhard's work is still supported - indeed, it opens new options for cross-machine collaboration. It is a first pass at making a very simple to setup and use device driving framework and I hope to make big improvements based on your experiences playing with it.

Making Smalltalk on ARM since 1986; making your Scratch better since 2012

Where should we look out for the more extensive documentation? I asked about the GPIO documentation in a comment on the blog post and got this response from Simon Long:

"Scratch in this release includes a new GPIO server, which allows broadcast blocks to be used to set GPIO state and sensor blocks to be used to read GPIO state. I’ll have a look to see if this is documented in a useful fashion anywhere…"

but from some quick Google searching, I'm not really clear if there's a single centralized location for documentation about new RPi Scratch releases.

I've provided a big chunk of info to the folk at Pi Towers and it ought to appear somewhere soon - perhaps even as tomorrow's blog if we're lucky. Meanwhile if you look at the Scratch examples directory (just hit the Examples shortcut in the file open dialogue) at the Motors and Sensors folder then you should see a group of new example projects named gpio-*. They should illustrate the basics decently -and if not, let me know so I can improve them!

Making Smalltalk on ARM since 1986; making your Scratch better since 2012

I tested Scratch 1.4 (Linux) 2015-09-15 in Raspbian Jessie and there is a bug concerning variables in the editor: when one adds a local variable (For this sprite only) and have no other variables before, one doesn't get the commands set, change, show, hide. If one creates a global variable one gets these commands.

I like the improvements. Thank you.
I've only found one problem so far. When I 'save picture of scripts' the file that's generated shows an error when I try to display it: "GIF file was missing some data (perhaps it was truncated somehow?)".
I suspect this will be a trivial problem to fix.

This is all great news and the speed increases are very impressive. I have some queries about the motor control however. It looks as if this is only provided through one of the supported add-on boards? I have been using Simon’s ScratchGPIO for a good while now and there are two features I hope can be implemented easily in the new Scratch.

The first is stepper motor control which is very useful. I drive a stepper motor through a ULN2803 chip directly from the GPIO pins. It would be great if I could do this in the new Scratch.

The second point is more technical. PWM is often fixed at 100Hz or higher and this is fine for things like dimming LEDs but when you want to control DC motors the frequency becomes important; at low power factors such motors simply stall. The solution is to run them at more like 10Hz so that the motor is getting decent bursts of power and it is possible to control down to a few revs per second. I contacted Simon about this last year and he re-wrote the interface to reduce the frequency when power is below 20%.

Is it possible to add these in the new Scratch or if not is it possible they will be implemented sometime? I think they are both very useful for anyone wanting to control models or robots.

A minor problem, also found when saving picture of scripts...
In the 'Save Scripts Window' there are 3 folder option icons. Clicking either 'Compute' or 'pi' (current user) open up the appropriate folder but clicking on 'Desktop' opens up the current user's home folder (i.e. same effect as second option) not the desktop folder. The windows for other filer operations have the same 'feature'.

iw1 wrote:I like the improvements. Thank you.
I've only found one problem so far. When I 'save picture of scripts' the file that's generated shows an error when I try to display it: "GIF file was missing some data (perhaps it was truncated somehow?)".
I suspect this will be a trivial problem to fix.

Hmm, that's odd.
a) it used to work and nothing has been changed in that area
b) the gif opens perfectly well on my iMac
c) the gif opens perfectly in another Squeak system

So I'm forced to the conclusion the Raspbian provided image viewer has an issue

Making Smalltalk on ARM since 1986; making your Scratch better since 2012

Michael_O wrote:[Copied from blog comments at Tim's suggestion]The first is stepper motor control which is very useful. I drive a stepper motor through a ULN2803 chip directly from the GPIO pins. It would be great if I could do this in the new Scratch.

Ah, but you can do that yourself and it should be trivial. You have full control over the pins; you (almost certainly) don't need any special driver at all. The caveat is that you may be speed limited when using a script to do it all. Depends. You can easily drive a Ryantek motor board direct from the gpio as well, for example.

Michael_O wrote:The second point is more technical. PWM is often fixed at 100Hz or higher and this is fine for things like dimming LEDs but when you want to control DC motors the frequency becomes important; at low power factors such motors simply stall. The solution is to run them at more like 10Hz so that the motor is getting decent bursts of power and it is possible to control down to a few revs per second.

So you'd want a way to set the pwm frequency? I *think* wiringPi can support that. Hmmm... looks plausible.

Making Smalltalk on ARM since 1986; making your Scratch better since 2012

iw1 wrote:Clicking either 'Compute' or 'pi' (current user) open up the appropriate folder but clicking on 'Desktop' opens up the current user's home folder (i.e. same effect as second option) not the desktop folder.

Good grief, so it does. That's a trivial typo that's been there a long time. I'll fix it ...

Making Smalltalk on ARM since 1986; making your Scratch better since 2012

iw1 wrote:I like the improvements. Thank you.
I've only found one problem so far. When I 'save picture of scripts' the file that's generated shows an error when I try to display it: "GIF file was missing some data (perhaps it was truncated somehow?)".
I suspect this will be a trivial problem to fix.

Hmm, that's odd.
a) it used to work and nothing has been changed in that area
b) the gif opens perfectly well on my iMac
c) the gif opens perfectly in another Squeak system

So I'm forced to the conclusion the Raspbian provided image viewer has an issue

Not quite so straightforward as this unfortunately. LibreOffice on both a Pi and a Windows 7 computer will also load the gif saved from the version of Scratch supplied with Jessie but, like the Raspian image viewer, Microsoft ImageViewer won't display it, neither can it be inserted into a Microsoft Word document, an error being reported. Microsoft Paint will load it but with a black background.
Whereas a gif produced using 'save picture of scripts' in Scratch 1.4 of 14-Jan-15 (running under Wheezy) will load into any of the programs mentioned above, including the Jessie image viewer, without error though there is also a black background in Microsoft Paint.