Visual Playground (Blockly)

Visual Playground (Blockly)

The Go Education Visual Playground lets you build programs by snapping blocks together - no syntax, no semicolons, just logic. Under the hood it generates real TinyGo code that you can copy and flash to your badge or board.

It is designed for first-time learners and classroom settings where typing code is a barrier, and pairs naturally with the step-by-step tutorials.

What you can do

  • Drag and drop blocks to build a program - no typing required
  • See the generated TinyGo / Go code on demand with the To Go button
  • Load demo programs (Hello World, FizzBuzz, Gopherino robot, DS18B20 sensor)
  • Save and load your workspace as XML
  • Copy generated code to clipboard and flash it to your badge or board

Available block categories

CategoryBlocks
LogicIf/else, comparisons, boolean operators
LoopsRepeat, while, for-range
MathNumbers, arithmetic, random
TextStrings, print, I/O
ListsCreate, get, set, length
ColourColor pickers and values
VariablesTyped variables (dynamic)
FunctionsDefine and call Go functions
TinyGoLED control, sleep, goroutines, defer, string conversion (atoi/itoa), read data, tuples
GopherBadgeButton input
GopherinoMovement, HC-SR04 distance sensor
Sensors - Temp/Hum/GasesBME280, BMP280, BMP180, BMP388, AHT20, DHT11/DHT22, HTS221, MCP9808, ADT7410, DS18B20, MAX6675, SGP30, SCD4X, ENS160
Sensors - Motion/IMUMPU6050/6886/9150, ADXL345, LIS3DH, MMA8653, BMA42x, LSM6DSOX, LSM6DS3/TR, BMI160, QMI8658c, L3GD20, LIS2MDL, MAG3110, LSM303AGR/DLHC, LSM9DS1, BNO08x, AS5600
Sensors - Distance/LightHC-SR04 (ultrasonic), BH1750 (light), APDS9960 (proximity/color/gesture), AMG88xx (thermal 8x8)
Sensors - Clock/RTCDS3231, PCF8523, PCF8563
Sensors - Power/CurrentINA219, INA260, AXP192, PCF8591 (ADC)
Sensors - InputKeypad4x4, rotary encoder, MCP3008 (ADC SPI), FT6336 (touch), IR receiver NEC
DisplaysSH1106 (OLED 128x64), Adafruit4650 (OLED 128x32), PCD8544/Nokia5110, ILI9341 (TFT 320x240), GC9A01 (round TFT 240x240), HD44780 (char LCD), IS31FL3731 (LED matrix), Hub75 (RGB matrix)
LEDsAPA102 (SPI strip), micro:bit 5x5 matrix, BlinkM (I2C RGB), WS2812/NeoPixel
Network/CommsESPAT (ESP8266/ESP32 WiFi), RTL8720DN (WiFi+BLE), SX127x (LoRa), MCP2515 (CAN bus)
Control/MotorsServo, buzzer, EasyStepper, L293x/L9110x (DC motor), PCA9685 (16-ch PWM), MCP23017 (GPIO expander)
OthersAT24Cx EEPROM, Seesaw (I2C coprocessor)
Net/HTTPCloudflare Workers, Fermyon Spin
Go FuncsDefine and call reusable Go functions

Building the playground

The playground is compiled from the blockly-tinygo project. Run the following script from the goeducation-site root to build and copy all files:

./update-blockly.sh

This script requires Node.js. It runs npm install && npm run build in ../blockly-tinygo, then copies the compiled output and the full playground UI to static/blockly-playground/.

docs