PiccoloBASIC – A BASIC interpreter for the Raspberry Pi Pico board

PiccoloBASIC is an open-source BASIC interpreter for the Raspberry Pi Pico development board that’s based on “uBASIC: a really simple BASIC interpreter” by Adam Dunkels and relying on Arm’s LittleFS fail-safe filesystem for microcontrollers.

If my memory serves me well, my first computing experience was at school using a Thomson TO7 computer that we programmed with BASIC. I don’t think the language is still used in practical applications, but we can still see some BASIC projects pop up from time to time such as a BASIC interpreter for the Arduino Zero boards. Gary Sims, owner of the Gary Explains YouTube channel, has now ported a BASIC interpreter to the Raspberry Pi Pico.


Raspberry Pi Pico BASICThe project is still work in progress, but currently implemented features include:

  • Let, if, print, for, goto, gosub
  • String variables (let z$=”hello”)
  • Floating point numbers and variables (let z#=1.234)
  • Builtin functions [zero, randint, not, time]
  • Sleep, delay, randomize, push & pop (for integers)
  • Maths functions like cos, sin, tan, sqr, etc
  • LittleFS support
  • Rudimentary GPIO support

But it’s still good enough for Hello World, Blinky, and other code samples. Here’s what Hello World looks like:

Raspberry Pi Pico’s 2MB flash has been partitioned to have the first 640KB for the PiccoloBASIC firmware, and the rest for LittleFS to add BASIC programs, Python scripts, and so on. Besides fixing a few bugs, Gary plans to work on more features such as peek and poke, longer variable names (currently just one letter), support for negative, 64-bit, and hex numbers, better loops (steps, reverse, while, etc..), File IO, and more hardware support with I2C, SPI, Bluetooth, USB keyboard, etc…

You’ll find the source code and more details on GitHub, and an introduction video on Gary Explains’ YouTube channel.

Note that it’s not the only BASIC interpreter for Raspberry Pi Pico as other projects that come up include PicoMite running the free MMBasic interpreter and JustPicoBasic by bgolab.

Share this:

Support CNX Software! Donate via cryptocurrencies or become a Patron on Patreon

ROCK Pi 4C Plus
Notify of
The comment form collects your name, email and content to allow us keep track of the comments placed on the website. Please read and accept our website Terms and Privacy Policy to post a comment.
5 months ago

How about the TinyBASIC/IoTBASIC from Stefan Lenz – which also works for the Pico and is really fast 😉

5 months ago

Impressive. Do you know if there’s a validation suite?

5 months ago

This TinyBasic is GPL. (for an embedded/combined program!) So it may be very bad as it’s hard to set boundaries on small cpu.

Tony Pugatschew
Tony Pugatschew
5 months ago

Check out mmbasic…go noto the backshed forum and see the materials
Or search fir pucomite
Fully featured with arrays…interrupts…lcd support etc
Basic is still useful

5 months ago

640kb seems an enormous amount for BASIC. I had a UK 101 and BASIC fitted into 8K.

Anybody out there old enough to remember the Ohio Superboard II, or UK101 clone?

5 months ago

Man, there is really a lot of real things to do. Micropython could use a lot of work, and the whole ecosystem. Why not contribute to a meaningful project instead? Is that not even better still? Granted a lot of people waste a lot of time on a lot of stuff but two wrongs don’t make a right…

Khadas VIM4 SBC