|
| 1 | +# Stellar Unicorn MicroPython Examples <!-- omit in toc --> |
| 2 | + |
| 3 | +- [About Stellar Unicorn](#about-stellar-unicorn) |
| 4 | +- [Stellar Unicorn and PicoGraphics](#stellar-unicorn-and-picographics) |
| 5 | +- [Examples](#examples) |
| 6 | + - [Clock](#clock) |
| 7 | + - [Eighties Super Computer](#eighties-super-computer) |
| 8 | + - [Feature Test](#feature-test) |
| 9 | + - [Feature Test With Audio](#feature-test-with-audio) |
| 10 | + - [Fire Effect](#fire-effect) |
| 11 | + - [Lava Lamp](#lava-lamp) |
| 12 | + - [Nostalgia Prompt](#nostalgia-prompt) |
| 13 | + - [Rainbow](#rainbow) |
| 14 | + - [Scrolling Text](#scrolling-text) |
| 15 | + - [Today](#today) |
| 16 | +- [Wireless Examples](#wireless-examples) |
| 17 | + - [Cheerlights History](#cheerlights-history) |
| 18 | + - [Stellar Paint](#stellar-paint) |
| 19 | + - [Exchange Ticker](#exchange-ticker) |
| 20 | + - [HTTP Text](#http-text) |
| 21 | + - [Weather](#weather) |
| 22 | +- [NumPy examples](#numpy-examples) |
| 23 | +- [Other Examples](#other-examples) |
| 24 | + - [Launch (Demo Reel)](#launch-demo-reel) |
| 25 | +- [Other Resources](#other-resources) |
| 26 | + |
| 27 | +## About Stellar Unicorn |
| 28 | + |
| 29 | +Stellar Unicorn offers 16x16 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! |
| 30 | + |
| 31 | +- :link: [Stellar Unicorn store page](https://shop.pimoroni.com/products/stellar-unicorn) |
| 32 | + |
| 33 | +Stellar Unicorn ships with MicroPython firmware pre-loaded, but you can download the most recent version at the link below (you'll want the `stellar-unicorn` image). |
| 34 | + |
| 35 | +- [MicroPython releases](https://github.com/pimoroni/pimoroni-pico/releases) |
| 36 | +- [Installing MicroPython](../../../setting-up-micropython.md) |
| 37 | + |
| 38 | +## Stellar Unicorn and PicoGraphics |
| 39 | + |
| 40 | +The easiest way to start displaying cool stuff on Stellar Unicorn is using our Stellar 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. |
| 41 | + |
| 42 | +- [Stellar Unicorn function reference](../../modules/stellar_unicorn/README.md) |
| 43 | +- [PicoGraphics function reference](../../modules/picographics/README.md) |
| 44 | + |
| 45 | +## Examples |
| 46 | + |
| 47 | +### Clock |
| 48 | + |
| 49 | +[clock.py](clock.py) |
| 50 | + |
| 51 | +Clock example with (optional) NTP synchronization. You can adjust the brightness with LUX + and -, and resync the time by pressing A. |
| 52 | + |
| 53 | +### Eighties Super Computer |
| 54 | + |
| 55 | +[eighties_super_computer.py](eighties_super_computer.py) |
| 56 | + |
| 57 | +Random LEDs blink on and off mimicing the look of a movie super computer doing its work in the eighties. You can adjust the brightness with LUX + and -. |
| 58 | + |
| 59 | +### Feature Test |
| 60 | + |
| 61 | +[feature_test.py](feature_test.py) |
| 62 | + |
| 63 | +Displays some text, gradients and colours and demonstrates button use. You can adjust the brightness with LUX + and -. |
| 64 | + |
| 65 | +### Feature Test With Audio |
| 66 | + |
| 67 | +[feature_test_with_audio.py](feature_test_with_audio.py) |
| 68 | + |
| 69 | +Displays some text, gradients and colours and demonstrates button use. Also demonstrates some of the audio / synth features. |
| 70 | +- Button A plays a synth tune |
| 71 | +- Button B plays a solo channel of the synth tune |
| 72 | +- Button C plays a sinewave (it's frequency can be adjusted with VOL + and -) |
| 73 | +- Button D plays a second sinewave (it's frequency can be adjusted with LUX + and -) |
| 74 | +- Sleep button stops the sounds |
| 75 | + |
| 76 | +### Fire Effect |
| 77 | + |
| 78 | +[fire_effect.py](fire_effect.py) |
| 79 | + |
| 80 | +A pretty, procedural fire effect. Switch between landscape fire and vertical fire using the A and B buttons! You can adjust the brightness with LUX + and -. |
| 81 | + |
| 82 | +### Lava Lamp |
| 83 | + |
| 84 | +[lava_lamp.py](lava_lamp.py) |
| 85 | + |
| 86 | +A 70s-tastic, procedural rainbow lava lamp. You can adjust the brightness with LUX + and -. |
| 87 | + |
| 88 | +### Nostalgia Prompt |
| 89 | + |
| 90 | +[nostalgia_prompt.py](nostalgia_prompt.py) |
| 91 | + |
| 92 | +A collection of copies of classic terminal styles including C64, MS-DOS, Spectrum, and more. Images and text are drawn pixel by pixel from a pattern of Os and Xs. You can adjust the brightness with LUX + and -. |
| 93 | + |
| 94 | +### Rainbow |
| 95 | + |
| 96 | +[rainbow.py](rainbow.py) |
| 97 | + |
| 98 | +Some good old fashioned rainbows! You can adjust the cycling speed with A and B, stripe width with C and D, hue with VOL + and -, and the brightness with LUX + and -. The sleep button stops the animation (can be started again with A or B). |
| 99 | + |
| 100 | +### Scrolling Text |
| 101 | + |
| 102 | +[scrolling_text.py](scrolling_text.py) |
| 103 | + |
| 104 | +Display scrolling wisdom, quotes or greetz. You can adjust the brightness with LUX + and -. |
| 105 | + |
| 106 | +### Today |
| 107 | + |
| 108 | +[today.py](today.py) |
| 109 | + |
| 110 | +Calendar example with (optional) NTP synchronization. You can adjust the brightness with LUX + and -, and resync the date by pressing C. |
| 111 | + |
| 112 | +## Wireless Examples |
| 113 | + |
| 114 | +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). |
| 115 | + |
| 116 | +- [micropython/examples/common](../../examples/common) |
| 117 | + |
| 118 | +### Cheerlights History |
| 119 | + |
| 120 | +[cheerlights_history.py](cheerlights_history.py) |
| 121 | + |
| 122 | +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) 16 hour clock! Find out more about the Cheerlights API at https://cheerlights.com/ |
| 123 | + |
| 124 | +You can adjust the brightness with LUX + and -. |
| 125 | + |
| 126 | +### Stellar Paint |
| 127 | + |
| 128 | +[stellar_paint](stellar_paint) |
| 129 | + |
| 130 | +Draw on your Stellar Unicorn from another device in real time, over wifi! |
| 131 | + |
| 132 | +This example needs the `micropython-phew` and `microdot` libraries (you can install these using Thonny's 'Tools > Manage Packages'). |
| 133 | + |
| 134 | +### Exchange Ticker |
| 135 | + |
| 136 | +[exchange_ticker.py](exchange_ticker.py) |
| 137 | + |
| 138 | +This example uses the Coinbase open API to collect the current exchange rates of various cryptocurrencies. |
| 139 | + |
| 140 | +Press A to change to a different base exchange currency. |
| 141 | + |
| 142 | +### HTTP Text |
| 143 | + |
| 144 | +[http_text](http_text) |
| 145 | + |
| 146 | +Display scrolling wisdom, quotes or greetz... from another computer or device! |
| 147 | + |
| 148 | +You can adjust the brightness with LUX + and -. |
| 149 | + |
| 150 | +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`. |
| 151 | + |
| 152 | +### Weather |
| 153 | + |
| 154 | +[weather](weather) |
| 155 | + |
| 156 | +Display current weather data from the [Open-Meteo](https://open-meteo.com/) weather API. |
| 157 | + |
| 158 | +## NumPy examples |
| 159 | + |
| 160 | +[numpy](numpy) |
| 161 | + |
| 162 | +The examples in the folder use `numpy`-like array functions contained in the `ulab` library for super fast graphical effects. |
| 163 | + |
| 164 | +## Other Examples |
| 165 | + |
| 166 | +### Launch (Demo Reel) |
| 167 | + |
| 168 | +[launch](launch) |
| 169 | + |
| 170 | +If you want to get the demo reel that Stellar Unicorn ships with back, copy the contents of this `launch` folder to your Pico W. |
| 171 | + |
| 172 | +## Other Resources |
| 173 | + |
| 174 | +Here are some cool Stellar 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. |
| 175 | + |
| 176 | +- :link: [Green Energy Display with Stellar Unicorn](https://www.hackster.io/andreas-motzek/clock-and-green-energy-display-with-stellar-unicorn-641dcb) |
| 177 | +- :link: [stellar-emoji-react - paint emojis from a computer, phone or tablet](https://github.com/chriscareycode/stellar-unicorn/tree/main/stellar-emoji-react) |
| 178 | +- :link: [stellar-paste - paste images from the clipboard to Stellar Unicorn](https://github.com/chriscareycode/stellar-unicorn/tree/main/stellar-paste) |
0 commit comments