Pi Shack BASIC - Now Available!

Written by on 2024-08-02 16:19:00 updated 2024-08-02 16:19:00

Pi Shack BASIC

NOTE: screen colors are my choice. The default is your terminal's.

Pi Shack BASIC has ARRIVED!!

Version 1.0 has just been released under a shareware license. It is the easiest and most interactive way to learn and experiment with hardware on and attached to SBCs. Type a command and watch your hardware do something. Type another to read its state. Manually fire off subroutines to in developing and testing hardware. It also has many UNIX related features like reading from another program or writing to one. Opening devices, optionally passing additional hardware parameters. And it comes with a full on-line reference manual!

Pi Shack BASIC (psBASIC) is a classic dialect of the language reminiscent of the interpreters that came built in to the earliest PCs from the '70s and '80s. It has some newer ANSI standard features like: it doesn't require line numbers, DO ("while" or "until", pre, post test or infinite) loops, multi-line IF statements, matrix operations, SELECT, FUNCTION and SUB constructs.

The dialect has been enhanced with many features to make it interact well with a Linux environment:

  • Opening uni-directional pipes to other programs.
  • "~" expansion in file names to make it easy to write home.
  • A "Binary" file mode to provide pretty much unrestricted access to globs of data wherever in a data stream, while allowing both reading and writing.
  • The "Binary" file mode also supports passing hardware parameters for UARTs (ttys), I2C and SPI ports.
  • Querying as well as setting the current working directory.
  • Access to command line arguments.
  • Access to environment variables as well as the ability to set them.
  • Classic I/O port style operations for accessing GPIO pins (INP/OUT).
  • The ability to return exit codes to calling programs.
  • Operates cleanly in a filter role.
  • You can call external programs and capture their exit codes.
  • Access to stderr.
  • Ability to open a print spooler (lpr), formatter (enscript) program or a device for printed output.

psBASIC comes in two editions: The Shareware edition and a licensed one. The Shareware edition is fully functional, with some limits and is free for anyone to use. The shareware limits are:

  • Limited to 3 open files at a time (simultogetherously open).
  • Limited to 3 GPIO pins at a time (for a program run).
  • Limited to 300 line programs.
  • Limited to 250K program and data RAM.
  • The DELIMIT command is unavailable.

For only $50 you can buy the fully licensed version and use all available system resources. Plus the licensed version comes with a utility to perform complex renumbering tasks (if needed) and the full reference in a single printable HTML file.

The shareware edition is getting released first. The licensed version will follow shortly. We're adding the licensing software to our web store. If you're impatient for a licensed copy feel free to email ChipMaster.

Getting Started

Download the installation package most appropriate for your specific architecture and OS. Start a terminal. Install it. (See the notes under the installation package section you downloaded from.) Agree to the license. Launch psb. And enter help "intro" at the psBASIC> prompt.

NOTE: In psBASIC line numbers are optional so unlike BASIC versions in the early PCs, line number based editors do not work. Instead of providing an editor, psBASIC, in UNIX fashion, uses which ever editor you prefer. Simply put your editor command in the $EDITOR environment variable and psBASIC will launch it with the appropriate file name when you use the EDIT command. If your environment variable is not set when you start psBASIC you can use a psBASIC command, like environ "EDITOR=...". Replace the "..." with the name of your editor. It can even be a GUI editor, when run in a GUI environment. Upon termination of your editor psBASIC will load the code that the editor has saved. Remember to use the psBASIC SAVE command to save the program permanently to disk.

GUI editing

Shareware Downloads

Which software download should I use?

If you have a Linux distro based on Debian (Devuan, Ubuntu, Raspbian, Armbian, ...) as most SBC distributions are, then you should download the "Debian" package for your CPU architecture, since it works with the built-in software management. Us Linux users, using either Debian or RPM based distros, are the only OS users with real software management. I encourage you to take advantage of it.

Debian packages (Debian, Devuan, Ubuntu, Raspbian, ...)

To install: Download the file and run sudo dpkg -i {file}. Replace {file} with the path name of the file you downloaded. Accept the license to complete the install. After it's installed launch it by typing psb [ENTER] in a terminal and type help [ENTER] to start learning what it can do. See the note about editors in "Getting Started" above.

WARNING: GUI package installers will not likely work. Use a terminal and the instructions above.

Binary Installers (all other Linuxes)

To install: Download the file. Give it the execute permission (chmod +x {file}). Then execute it from a terminal as root (using sudo, su, ...). Replace {file} with the path name of the file you downloaded. Accept the license to complete the install. psBASIC does not require any dependencies. After it's installed launch it by typing psb [ENTER] in a terminal and type help [ENTER] to start learning what it can do. See the note about editors in "Getting Started" above.

NOTE: After the installer has been run it will drop a list of all installed files in a file named psbasic-install.log in the current directory. You can use this list to remove it if you wish to uninstall it. Or its informative if you want to see what is in the package.