Pico Logo—A fun programming language

I am happy to announce the release of Pico Logo for the PicoCalc.

Logo is a fun and easy way to program your PicoCalc! The project site includes a full reference manual to get you started with classic Logo fundamentals. In addition, the internet is full of resources to get started and then to advance to more complex solutions.

Feature Highlights:

  • 320×320 resolution turtle graphics with 256 colours (from a palette of 65K colours)
  • Three simultaneous display modes: full screen text for programs without graphics, full screen graphics for running graphical programs, and split screen for interactive use
  • Full line editing and history
  • Compatible with Logo books and manuals from the 1980s and 1990s.
  • Variables, procedures, control structures (if, repeat), lists, arithmetic, and logical operations.
  • Uses 32-bit floats for numerical calculations, with fallback for integer-only hardware.
  • Manage files (catalog, setprefix, erasefile, …) and load and save Logo programs to and from a SD card formatted as FAT32.

I will use this thread to post updates on this project.

15 Likes

Release 1

This is the initial release. These will be bugs here and there.

The release is not optimized. I looking for correct first then I can make it fast.

Please help with providing feedback and reporting any problems you find.

Extract the archive, logo.zip, onto your SD Card in a subfolder named “Logo”.


8 Likes

LOGO was my introduction to programming, many many many moons ago. fantastic work!

3 Likes

Release 2

What’s Changed

  • Update color palette definitions and improve documentation clarity
  • Improved LCD initialization
  • Added science-based books to README.md

Tips

  • setbg changes the colour of the background, examples
    • setbg 42 - purple
    • setbg 104 - green
    • setbg 74 - blue (default)

3 Likes

Release 3

What’s Changed

  • Enhance turtle movement and boundary handling
  • Add the toot primitive
  • Implement reverse video support for character and string rendering

Tips

  • Mono sound can be produced with toot 500 440 (quarter note A) or stereo with (toot 500 330 440) (quarter note of A and E)
  • wrap (default) the drawing wraps from one edge to the opposite edge, window only show the drawing that are drawn in the coordinates of the screen, or fence displays an error if the turtle moves beyond the screen edges.

2 Likes

Wow, looks like an incredible piece of work! Looking forward to experimenting with it over the Christmas break.

1 Like

Release 4

What’s Changed

  • Correct the primitive towards
  • Add screensaver functionality to prevent LCD image persistence
  • Implement flood fill functionality for turtle graphics
  • Add shape management primitives
  • Bug fixes around input on the split screen

Tips

  • I noticed that the PicoCalc’s display is susceptible to LCD image persistence (not permanent). In this release, after 5 minutes of waiting for input, the screen will start cycling shades and hues (as the Atari 8-bits do). Any key press will return the screen to normal.
  • Flood fill arrives!
  • You can change the shape of the turtle (up to 15 shapes), examples:
    • alien - putsh 1 [24 60 126 90 90 90 126 231 189 189 165 36 36 36 102 0]
    • turtle - putsh 2 [8 28 28 8 93 127 62 127 127 127 127 127 62 62 93 65]
    • See getsh and putsh in the reference guide. Use setsh to change the turtle’s shape.

2 Likes

This is a very cool app. I especially like the switch between text mode, combined and graphic with f1,2,3. Thanks!

I tried a few sample from: Logo Workshop Homepage, chapter basic loops, all work!

3 Likes

Thank you!

Please let me know if you find any problems. Note that some primitives may be different so check the reference guide to see how to do what you need to do in Pico Logo.

Release 5

The release moves from alpha quality of the previous releases to beta quality.

Overall stability and proper operation was the focus of this release, along with a full-display editor that allows you to edit procedures, variables and files on the SD Card.

Please let me know if you find any problems. I would appreciate any feedback you wish to provide.

What’s Changed

  • Implement infix equality operator for words and numbers
  • Refactor number formatting
  • Full screen editor
  • Screen mode switching during execution
  • Refactor turtle background handling
  • Optimize line drawing
  • Edit improvements
  • Implement pause and freeze functionality
  • Improved memory safety
  • Enhance error propagation and control flow handling in eval and catch
  • Refactor error handling to enhance error message formatting
  • Fix Label/go and error messages
  • Implement step-by-step execution for procedures
  • Report error in procedure
  • Update input_can_read to handle mode-switching keys
  • Add ‘savel’ command to save specified procedures and variables to a file
  • Improve file handling
  • Use memmove and optimize memory operations in editor
  • Bug fixes

4 Likes

Nice work! Ran a few demos dreamt up by AI:

:smiling_face:

1 Like

I guess AI can create art in in Logo as well! :grinning_face:

Tried the ‘save “startup” command (with buryall and others), and got this:

I’m having trouble with the disk.

(Maybe something trivial, I did not yet read your code to search cause).

I also tried to edit “startup with editor, quit with esc, nothing saved, catalog does not list anything.

It looks like Logo cannot mount the SD Card. Logo can only read cards formatted with FAT32.

It’s really tough to diagnose these problems as each SD Card is a hardware device that you are inserting, unlike a floppy where the floppy drive (hardware device) is part of the computer and you are inserting media.

Would you be able to try a different SD Card? I have tested Logo with the SD Card that came with the PicoCalc.

I did test with all the cards I own (a few different brands) and I did have to made changes to the code to get them all to work.

Logo uses the same driver as the PicoCalc Text Starter Kit. It would be interesting to see if your card also fails with it as well.

What card are you using?

The one provided by clockworkpi with picocalc. Picocalc-text-starter can list files with the dir command, but after reboot, pico-logo not. Strange enough. I have a debug-probe, can it be useful for the diagnostic? I never used it :slight_smile:

I’m going to go with a simple cause first. Can you try:

?setprefix “/
?catalog

Thanks, this works, I can see the root directory of the sd card and able to create files, directories.

My fault, I should have made the documentation clearer.

I have already updated the reference manual and I have made some code changes to let you better know what is happening, which will be in the next release.

Release 6

This release adds many quality of life improvements to the editor: auto-indentation, auto-closing of brackets, modern home behaviour, editing of your workspace with edall, and more. Also I added prefix filtering to the prompt to search through your history easier.

I corrected define/text to match Logo semantics and additional bug fixes. I also improved setprefix to display an error message if the directory does not exist.

I refactored many areas in the code base for clarity and maintainability.

Now I include the Pico Logo Reference as a PDF (a little over 100 pages!) with each release.

What’s Changed

  • Editor improvements
  • Check setprefix valid; add erf for erasefile
  • Add prefix-based history search functionality in input handling
  • Refactor procedure body structure to use list-of-lists
  • Refactor for simplicity and clarity

3 Likes