Skip to content
/ picos Public

A simple OS for the Raspberry Pi Pico with the Unicorn accessory

Notifications You must be signed in to change notification settings

adamsuk/picos

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PicOS

This repo contains the resources and code needed to play games on the Raspberry Pi Pico with the Pico Unicorn accessory.

These games are written in Python and have been developed for MicroPython with the picounicorn package.

GAMES!

Pong - a nice little competitive game between friends

Snake - a decent distraction when trying to think through problems!

pico_snake.mp4

Getting Started

Assuming you have all the hardware setup (Pico, header pins and Unicorn display) you need to do the following as prerequisites to getting any Pico Unicorn code to run:

  • If you haven't used the Pico before download either Thonny or VSCode with the Pico extension.
  • If already loaded with a UF2 then the Pico needs resetting with the flash nuke.
  • Load the Pico Unicorn version of MicroPython updates can be found here. This allows you to use the picounicorn package on the Pico.

I personally use Thonny on a Raspberry Pi 4 because it completely simplifies the setup so all I have to worry about is code.

Running Code on your Pico!

The Pico works in a really simplistic way. Anything uploaded to the root called main.py will be ran automatically.

This is the start of an extremely simplified OS for the Pico so for the time being it'll give you a list of importable games from the games subdirectory. To run this as a whole copy all .py files across to your Pico and both pong.py and snake.py will be options available to you. To exit out of these games press A + X together.

TODO:

  • PicoGame abstraction - both pong and snake contain code that can be abstracted out, ideal for an Abstract Base Class!
  • Text scrolling - I bashed this together using existing code for displaying the game scores but it would be best if it scrolled the other way for the menu.
  • Customisation - I'd LOVE to build in options so game booleans (like walls in snake or infinite looping paddles in pong) can be toggled on/off. Also custom colours. Store these in a JSON on the Pico and they'll persist too!
  • More games and other things!! Like a tiny calculator or game high scores ... the possibilities are endless.

Thanks

Firstly I need to give a shout out to pippayy and her PONG.py code. Without stumbling on her LinkedIn video I wouldn't have started this project and the Picos I preordered would've gathered dust for a little while longer. I used her project as a starter for 10, did a little refactoring, fixed a couple of bugs then got to work on my own take on a classic :)

About

A simple OS for the Raspberry Pi Pico with the Unicorn accessory

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages