Cosmic: add examples readme

This commit is contained in:
Hel Gibbons 2023-02-27 14:18:11 +00:00
parent 3e44edf66a
commit c194fc7a2b
1 changed files with 59 additions and 32 deletions

View File

@ -1,7 +1,7 @@
# Galactic Unicorn MicroPython Examples <!-- omit in toc -->
# Cosmic Unicorn MicroPython Examples <!-- omit in toc -->
- [About Galactic Unicorn](#about-galactic-unicorn)
- [Galactic Unicorn and PicoGraphics](#galactic-unicorn-and-picographics)
- [About Cosmic Unicorn](#about-cosmic-unicorn)
- [Cosmic Unicorn and PicoGraphics](#cosmic-unicorn-and-picographics)
- [Examples](#examples)
- [Clock](#clock)
- [Eighties Super Computer](#eighties-super-computer)
@ -12,29 +12,33 @@
- [Nostalgia Prompt](#nostalgia-prompt)
- [Rainbow](#rainbow)
- [Scrolling Text](#scrolling-text)
- [Today](#today)
- [Wireless Examples](#wireless-examples)
- [Cheerlights History](#cheerlights-history)
- [Galactic Paint](#galactic-paint)
- [Cosmic Paint](#cosmic-paint)
- [Exchange Ticker](#exchange-ticker)
- [HTTP Text](#http-text)
- [Weather](#weather)
- [Numpy examples](#numpy-examples)
- [Other Examples](#other-examples)
- [Launch (Demo Reel)](#launch-demo-reel)
- [Other Resources](#other-resources)
## About Galactic Unicorn
## About Cosmic Unicorn
Galactic Unicorn offers 53x11 bright RGB LEDs driven by Pico W's PIO in addition to a 1W amplifier + speaker, a collection of system and user buttons, and two Qw/ST connectors for adding external sensors and devices. Woha!
Cosmic Unicorn offers 53x11 bright RGB LEDs driven by Pico W's PIO in addition to a 1W amplifier + speaker, a collection of system and user buttons, and two Qw/ST connectors for adding external sensors and devices. Woha!
- :link: [Galactic Unicorn store page](https://shop.pimoroni.com/products/galactic-unicorn)
- :link: [Cosmic Unicorn store page](https://shop.pimoroni.com/products/cosmic-unicorn)
Galactic Unicorn ships with MicroPython firmware pre-loaded, but you can download the most recent version at the link below (you'll want the `galactic-unicorn` image).
Cosmic Unicorn ships with MicroPython firmware pre-loaded, but you can download the most recent version at the link below (you'll want the `cosmic-unicorn` image).
- [MicroPython releases](https://github.com/pimoroni/pimoroni-pico/releases)
- [Installing MicroPython](../../../setting-up-micropython.md)
## Galactic Unicorn and PicoGraphics
## Cosmic Unicorn and PicoGraphics
The easiest way to start displaying cool stuff on Galactic Unicorn is using our Galactic Unicorn module (which contains a bunch of helpful functions for interacting with the buttons, adjusting brightness and suchlike) and our PicoGraphics library, which is chock full of useful functions for drawing on the LED matrix.
The easiest way to start displaying cool stuff on Cosmic Unicorn is using our Cosmic Unicorn module (which contains a bunch of helpful functions for interacting with the buttons, adjusting brightness and suchlike) and our PicoGraphics library, which is chock full of useful functions for drawing on the LED matrix.
- [Galactic Unicorn function reference](../../modules/galactic_unicorn/README.md)
- [Cosmic Unicorn function reference](../../modules/cosmic_unicorn/README.md)
- [PicoGraphics function reference](../../modules/picographics/README.md)
## Examples
@ -98,9 +102,15 @@ Some good old fashioned rainbows! You can adjust the cycling speed with A and B,
Display scrolling wisdom, quotes or greetz. You can adjust the brightness with LUX + and -.
### Today
[today.py](today.py)
Calendar example with (optional) NTP synchronization. You can adjust the brightness with LUX + and -, and resync the date by pressing C.
## Wireless Examples
These examples need `WIFI_CONFIG.py` (from the `common` directory) to be saved to your Pico W. Open up `WIFI_CONFIG.py` in Thonny to add your wifi details (and save it when you're done).
These examples need `WIFI_CONFIG.py` and `network_manager.py` (from the `common` directory) to be saved to your Pico W. Open up `WIFI_CONFIG.py` in Thonny to add your wifi details (and save it when you're done).
- [micropython/examples/common](../../examples/common)
@ -108,19 +118,47 @@ These examples need `WIFI_CONFIG.py` (from the `common` directory) to be saved t
[cheerlights_history.py](cheerlights_history.py)
Updates one pixel every five minutes to display the most recent #Cheerlights colour. Discover the most popular colours over time, or use it as an avant garde (but colourful) 53 hour clock! Find out more about the Cheerlights API at https://cheerlights.com/
Requires `WIFI_CONFIG.py` and `network_manager.py` from the `common` directory.
Updates one pixel every two minutes to display the most recent #Cheerlights colour. Discover the most popular colours over time, or use it as an avant garde (but colourful) 32 hour clock! Find out more about the Cheerlights API at https://cheerlights.com/
You can adjust the brightness with LUX + and -.
### Galactic Paint
### Cosmic Paint
[galactic_paint](galactic_paint)
[cosmic_paint](cosmic_paint)
Draw on your Galactic Unicorn from another device in real time, over wifi!
Draw on your Cosmic Unicorn from another device in real time, over wifi!
Requires `WIFI_CONFIG.py` from the `common` directory. It also needs the `micropython-phew` and `microdot` libraries (you can install these using Thonny's 'Tools > Manage Packages').
This example needs the `micropython-phew` and `microdot` libraries (you can install these using Thonny's 'Tools > Manage Packages').
### Exchange Ticker
[exchange_ticker.py](exchange_ticker.py)
This example uses the Coinbase open API to collect the current exchange rates of various cryptocurrencies.
Press A to change to a different base exchange currency.
### HTTP Text
[http_text](http_text)
Display scrolling wisdom, quotes or greetz... from another computer or device!
You can adjust the brightness with LUX + and -.
Requires `logging.mpy` and `tinyweb` from [micropython/examples/common](../../examples/common) - copy these into the `lib` folder on your Pico W. You'll also need `index.html` to be saved alongside `html_text.py`.
### Weather
[weather](weather)
Display current weather data from the [Open-Meteo](https://open-meteo.com/) weather API.
## Numpy examples
[numpy](numpy)
The examples in the folder use `numpy` (part of the `ulab` library) for super fast graphical effects.
## Other Examples
@ -128,15 +166,4 @@ Requires `WIFI_CONFIG.py` from the `common` directory. It also needs the `microp
[launch](launch)
If you want to get the demo reel that Galactic Unicorn ships with back, copy the contents of this `launch` folder to your Pico W.
## Other Resources
Here are some cool Galactic Unicorn community projects and resources that you might find useful / inspirational! Note that code at the links below has not been tested by us and we're not able to offer support with it.
- :link: [Galactic Unicorn MQTT scroller (and 3D printed case)](https://github.com/ucl-casa-ce/Galactic-Unicorn-MQTT-Scroller)
- :link: [Compiling custom pimoroni-pico MicroPython (with ulab)](https://medium.com/@iestynlloyd/galactic-unicorns-and-custom-pimoroni-pico-firmware-38dd7c5913b8)
- :link: [Galactic Unicorn Graphical Workout](https://www.instructables.com/Galactic-Unicorn-Graphical-Workout/)
- :link: [Galactic Unicorn Bounce - Simple GFX Demo](https://www.instructables.com/Galactic-Unicorn-Bounce-Simple-GFX-Demo/)
- :link: [Cheerlights + Galactic Unicorn + MicroPython (beginner-friendly tutorial)](https://cheerlights.com/cheerlights-raspberry-pi-pico-w-micropython/)
- :link: [CheerClock (plus laser-cut templates for a fancy case/diffuser)](https://github.com/seanosteen/CheerClock)
If you want to get the demo reel that Cosmic Unicorn ships with back, copy the contents of this `launch` folder to your Pico W.