SmallBASIC PiGPIO 2 logo
Last update: 06.02.2026

SmallBASIC PiGPIO 2

If you want to let a LED blink or measure the temperature in your room, you can use SmallBASIC on a Raspberry PI. As an example you can connect a LED and a resistor to a GPIO-Pin of your Raspberry Pi, write a short SmallBASIC programm and enjoy the blinking LED:

import gpio

const PIN_GPIO4 = 4

gpio.SetOutput(PIN_GPIO4)

for ii = 1 to 5
  gpio.Write(PIN_GPIO4, 1)
  delay(500)
  gpio.Write(PIN_GPIO4, 0)
  delay(500)
next
Blinking LED

News

October 24 2026: Add support for HD44780 text displays. Please update SmallBASIC to version 12.35. See setup for more information.

February 6 2025: Fixed GPIO at Raspberry Pi OS Trixi: GPIO access at the newest Raspberry Pi OS (Trixi) was broken, because Debian updated libgpiod to version 2. Some functions of the SmallBASIC GPIO library changed and therefore rewrite of your code might be necessary. Several new features were added, i.e. define pullup or pulldown, or read and write multiple pins simultaneously.

Setup and Pin Numbering

Function Reference and Examples

Supported Hardware


[Back to main page]