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.
The 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:
1 2 3 4 |
loop: print "Hello World" sleep 1 goto loop: |
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.
Jean-Luc started CNX Software in 2010 as a part-time endeavor, before quitting his job as a software engineering manager, and starting to write daily news, and reviews full time later in 2011.
Support CNX Software! Donate via cryptocurrencies, become a Patron on Patreon, or purchase goods on Amazon or Aliexpress
How about the TinyBASIC/IoTBASIC from Stefan Lenz – which also works for the Pico and is really fast 😉
Impressive. Do you know if there’s a validation suite?
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.
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
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?
https://www.flaxcottage.com/UK101/Default.asp
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…