Discuss Scratch

flyboy74
New to Scratch
1 post

creating blocks for RPi robots

Hi all I am new to scratch.

I create lots of robots using RPi as the brain to run the robot and usually write the code in Python. I also coach kids in robotics and programing usually using the Lego Mindstorm platform.

I want to create educational robots using the RPi as a brain and have and have the kids program them using scratch.

Basically I want to be able to call routines that have written in python as a scratch block i.e the function that controls the PMW board via I2C interface or the function that writes an image to the 2.2" LCD display via SPI interface.

I did a little googling and the thing I found was blockext which seems functional for what I want to do but very light on docs and doesn't seem to have anything current in last 3 yrs. Is bloclext the best thing to use or is there something different everyone is using???
SilverBlueCat
New to Scratch
5 posts

creating blocks for RPi robots

I found this tutorial link https://github.com/blockext/blockext/blob/master/doc/tutorial.rst not sure it could help.
SouthwoldCC
Scratcher
2 posts

creating blocks for RPi robots

The Raspberry Pi already has a version of Scratch 1.4 included in the standard Raspbian OS, which allows access to the gpio pins. There are also some 3rd party versions that give a bit more functionality - I use ScratchGPIO (available here: http://simplesi.net/scratchgpio/scratch-raspberrypi-gpio/ ) both at home and in my primary school Computer Clubs.

Also, I understand that the Raspberry Pi Foundation are will soon be releasing a version that works with Scratch 2.0.

Darren.
mstone326
Scratcher
1000+ posts

creating blocks for RPi robots

SouthwoldCC wrote:

The Raspberry Pi already has a version of Scratch 1.4 included in the standard Raspbian OS, which allows access to the gpio pins. There are also some 3rd party versions that give a bit more functionality - I use ScratchGPIO (available here: http://simplesi.net/scratchgpio/scratch-raspberrypi-gpio/ ) both at home and in my primary school Computer Clubs.

Also, I understand that the Raspberry Pi Foundation are will soon be releasing a version that works with Scratch 2.0.

Darren.

That update is available. Scratch 2.0 is now on RPi. I am planning on introducing more of the same at the school I work. I'll be testing out the 2.0 version today. I will try to report back with ease of use and whatnot.

Edit:

Just spent the last 3 hours messing with the GPIO pins in Scratch 2.0 on RPi. Much much easier to work with than 1.4. The big issue is how slow 2.0 runs, which the Pi team spoke about on their website. However, working just with the pins was great. I am going back in to work on a few more things. But a great addition 2.0 to RPi.

Last edited by mstone326 (June 25, 2017 20:18:26)


High School Athletic Director / Middle School Tech Teacher / High School Baseball Coach
Kung Fu by Nintendo 1984 - https://scratch.mit.edu/projects/369994801/
Taco Defense - Speed Typing - https://scratch.mit.edu/projects/316795450/
Halloween Boss Battle - Taking Back our Woods - https://scratch.mit.edu/projects/257155118/
Almost Pong - https://scratch.mit.edu/projects/656276979/
Studio - My Best Projects - https://scratch.mit.edu/studios/4125978/
Forum Help Project Examples - https://scratch.mit.edu/studios/4133335
SimpleScratch
Scratcher
500+ posts

creating blocks for RPi robots

The big issue is how slow 2.0 runs,
I'm not seeing any noticeable slowness on my Pi3 - is there a particular operation that goes slowly for you (or are you using a Pi2?)

Simon
mstone326
Scratcher
1000+ posts

creating blocks for RPi robots

I'm using a Pi 3. Download my Simon project from my profile and run that on Scratch 2.0 on Pi and you'll see what I mean. I assume it is the graphic effects of flashing the lights.

But the speed using the GPIO pins was flawless. Had a lot of fun with that.

High School Athletic Director / Middle School Tech Teacher / High School Baseball Coach
Kung Fu by Nintendo 1984 - https://scratch.mit.edu/projects/369994801/
Taco Defense - Speed Typing - https://scratch.mit.edu/projects/316795450/
Halloween Boss Battle - Taking Back our Woods - https://scratch.mit.edu/projects/257155118/
Almost Pong - https://scratch.mit.edu/projects/656276979/
Studio - My Best Projects - https://scratch.mit.edu/studios/4125978/
Forum Help Project Examples - https://scratch.mit.edu/studios/4133335
SimpleScratch
Scratcher
500+ posts

creating blocks for RPi robots

Download my Simon project from my profile and run that on Scratch 2.0 on Pi and you'll see what I mean.
I see what you mean now

I've just been playing with pins (which is what I use Scratch for on Pi) and luckily,as you say, the speed of that is fine.

I ran your Simon game thru the Chromium browser on my Pi and the speed of that seemed quite acceptable so all is not lost
mstone326
Scratcher
1000+ posts

creating blocks for RPi robots

SimpleScratch wrote:

Download my Simon project from my profile and run that on Scratch 2.0 on Pi and you'll see what I mean.
I see what you mean now

I've just been playing with pins (which is what I use Scratch for on Pi) and luckily,as you say, the speed of that is fine.

I ran your Simon game thru the Chromium browser on my Pi and the speed of that seemed quite acceptable so all is not lost

Yes, on the Chromium browser it was all good. Just not in Scratch 2.0 on RPi. It is because of the flash workaround they use, they talk about it on the website about the update.


High School Athletic Director / Middle School Tech Teacher / High School Baseball Coach
Kung Fu by Nintendo 1984 - https://scratch.mit.edu/projects/369994801/
Taco Defense - Speed Typing - https://scratch.mit.edu/projects/316795450/
Halloween Boss Battle - Taking Back our Woods - https://scratch.mit.edu/projects/257155118/
Almost Pong - https://scratch.mit.edu/projects/656276979/
Studio - My Best Projects - https://scratch.mit.edu/studios/4125978/
Forum Help Project Examples - https://scratch.mit.edu/studios/4133335
Snaackker
Scratcher
76 posts

creating blocks for RPi robots

i searched on googz scratch bots. the thing i was looking for is scratch bots. scratch cheats by making robots that make projects and join scratch so scratch can have more projects
Mark05Man
Scratcher
17 posts

creating blocks for RPi robots

change [ 7777



y (0)

Last edited by Mark05Man (June 16, 2020 22:00:15)

Powered by DjangoBB