pimoroni-pico/micropython/examples/galactic_unicorn/README.md

132 wiersze
5.2 KiB
Markdown
Czysty Zwykły widok Historia

2022-11-02 16:58:18 +00:00
# Galactic Unicorn MicroPython Examples <!-- omit in toc -->
2022-11-03 15:31:21 +00:00
- [About Galactic Unicorn](#about-galactic-unicorn)
2022-11-02 16:58:18 +00:00
- [Galactic Unicorn and PicoGraphics](#galactic-unicorn-and-picographics)
- [Examples](#examples)
- [Clock](#clock)
- [Eighties Super Computer](#eighties-super-computer)
- [Feature Test](#feature-test)
- [Feature Test With Audio](#feature-test-with-audio)
- [Fire Effect](#fire-effect)
- [Lava Lamp](#lava-lamp)
- [Nostalgia Prompt](#nostalgia-prompt)
- [Rainbow](#rainbow)
- [Scrolling Text](#scrolling-text)
- [Wireless Examples](#wireless-examples)
2022-11-03 15:20:28 +00:00
- [Cheerlights History](#cheerlights-history)
2022-11-02 16:58:18 +00:00
- [Galactic Paint](#galactic-paint)
2022-11-03 15:42:45 +00:00
- [Other Examples](#other-examples)
2022-11-03 15:31:21 +00:00
- [Launch (Demo Reel)](#launch-demo-reel)
## About Galactic 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!
- :link: [Galactic Unicorn store page](https://shop.pimoroni.com/products/galactic-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).
- [MicroPython releases](https://github.com/pimoroni/pimoroni-pico/releases)
- [Installing MicroPython](../../../setting-up-micropython.md)
2022-11-02 16:58:18 +00:00
## Galactic Unicorn and PicoGraphics
2022-11-03 15:20:28 +00:00
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.
2022-11-02 16:58:18 +00:00
2022-11-03 15:48:21 +00:00
- [Galactic Unicorn function reference](../../modules/galactic_unicorn/README.md)
- [PicoGraphics function reference](../../modules/picographics/README.md)
2022-11-02 16:58:18 +00:00
## Examples
### Clock
[clock.py](clock.py)
2022-11-04 10:57:53 +00:00
Clock example with (optional) NTP synchronization. You can adjust the brightness with LUX + and -, and resync the time by pressing A.
2022-11-02 16:58:18 +00:00
### Eighties Super Computer
[eighties_super_computer.py](eighties_super_computer.py)
2022-11-04 10:57:53 +00:00
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 -.
2022-11-02 16:58:18 +00:00
### Feature Test
[feature_test.py](feature_test.py)
2022-11-04 10:57:53 +00:00
Displays some text, gradients and colours and demonstrates button use. You can adjust the brightness with LUX + and -.
2022-11-02 16:58:18 +00:00
### Feature Test With Audio
[feature_test_with_audio.py](feature_test_with_audio.py)
2022-11-03 15:20:28 +00:00
Displays some text, gradients and colours and demonstrates button use. Also demonstrates some of the audio / synth features.
2022-11-04 10:57:53 +00:00
- Button A plays a synth tune
- Button B plays a solo channel of the synth tune
- Button C plays a sinewave (it's frequency can be adjusted with VOL + and -)
- Button D plays a second sinewave (it's frequency can be adjusted with LUX + and -)
- Sleep button stops the sounds
2022-11-02 16:58:18 +00:00
### Fire Effect
[fire_effect.py](fire_effect.py)
2022-11-04 10:57:53 +00:00
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 -.
2022-11-02 16:58:18 +00:00
### Lava Lamp
[lava_lamp.py](lava_lamp.py)
2022-11-04 10:57:53 +00:00
A 70s-tastic, procedural rainbow lava lamp. You can adjust the brightness with LUX + and -.
2022-11-02 16:58:18 +00:00
### Nostalgia Prompt
[nostalgia_prompt.py](nostalgia_prompt.py)
2022-11-04 10:57:53 +00:00
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 -.
2022-11-02 16:58:18 +00:00
### Rainbow
[rainbow.py](rainbow.py)
2022-11-04 10:57:53 +00:00
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).
2022-11-02 16:58:18 +00:00
### Scrolling Text
[scrolling_text.py](scrolling_text.py)
2022-11-04 10:57:53 +00:00
Display scrolling wisdom, quotes or greetz. You can adjust the brightness with LUX + and -.
2022-11-02 16:58:18 +00:00
## Wireless Examples
2022-11-03 15:42:45 +00:00
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).
2022-11-03 15:31:21 +00:00
- [micropython/examples/common](../../examples/common)
2022-11-03 15:20:28 +00:00
### Cheerlights History
2022-11-02 16:58:18 +00:00
2022-11-03 15:20:28 +00:00
[cheerlights_history.py](cheerlights_history.py)
2022-11-02 16:58:18 +00:00
2022-11-03 15:20:28 +00:00
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/
2022-11-02 16:58:18 +00:00
2022-11-03 15:42:45 +00:00
Requires `WIFI_CONFIG.py` and `network_manager.py` from the `common` directory.
2022-11-02 16:58:18 +00:00
2022-11-04 10:57:53 +00:00
You can adjust the brightness with LUX + and -.
2022-11-02 16:58:18 +00:00
### Galactic Paint
[galactic_paint](galactic_paint)
2022-11-03 15:42:45 +00:00
Draw on your Galactic Unicorn from another device in real time, over wifi!
2022-11-02 16:58:18 +00:00
2022-11-03 15:44:43 +00:00
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').
2022-11-03 15:42:45 +00:00
## Other Examples
2022-11-03 15:20:28 +00:00
2022-11-03 15:31:21 +00:00
### Launch (Demo Reel)
2022-11-03 15:20:28 +00:00
[launch](launch)
2022-11-03 15:31:21 +00:00
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.
2022-11-02 16:58:18 +00:00