Raspblocks: Blocks-based Python coding for Raspberry Pi

Raspblocks is a new Blocks-based web programming environment for Raspberry Pi. You don’t even need to write the code a Raspberry Pi, but the Python 3 code it produces will need to be transferred to a Raspberry Pi to run.

For maximum authenticity (and slowness), I fired up  http://www.raspblocks.com/ on a Raspberry Pi Zero over VNC. It took a minute or more to load up the site in Chromium, but creating a simple program was all easy dragging and dropping:

The code it produced was pretty much exactly what you’d write by hand:

import RPi.GPIO as GPIO
import time
GPIO.setmode(GPIO.BCM)
GPIO.setup(26, GPIO.OUT)

while True:
    GPIO.output(26,True)
    time.sleep(1)
    GPIO.output(26,False)
    time.sleep(1)

And, as you might expect, the code make an LED connected to GPIO 26 turn on and off. Science!

Raspblocks isn’t as polished as its more established rival  EduBlocks, but Raspblocks doesn’t need any software installed. Edublocks installs its own Node.js-based web service, which would be painfully slow on a Raspberry Pi Zero. Raspblocks’ code needs to be run manually from a terminal, but I’d put up with that any day over having yet another Node server distribution installed under /opt.

not-very-good MakeCode scratchpad

Update:now updated all to include the Bluetooth module so these can be uploaded to your micro:bit with the (remarkably poor) mobile app. If you don’t include the Bluetooth module (or want to use the Radio module) you lose the ability to program over the air.

Boring Blink:

Shake temperature:

Shake temperature in ˚F: