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, become a Patron on Patreon, or purchase goods on Amazon or Aliexpress

Radxa Orion O6 Armv9 mini-ITX motherboard
Subscribe
Notify of
guest
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.
6 Comments
oldest
newest
Boardcon CM3588 Rockchip RK3588 System-on-Module designed for AI and IoT applications