Software for your Pimoroni Galactic Unicorn that brings the best effects and animations to life. Use the onboard buttons to switch views, customize text colors, adjust brightness, and much more. Many effects and animations also feature custom sounds for an immersive experience.
The effects in this software are written in Python and designed to be easy to use, modify individually, and test. Suggestions for new effects or animations are always welcome. Thank you for checking out this project!
- Build Status
- Parts List
- Previews
- Software Guide
- Wi-Fi Setup
- User Options
- Software Setup
- Development
- Licensing
- Wrapping Up
[ Index ]
Part | Price (USD) |
---|---|
Pimoroni Galactic Unicorn | $65.00 |
[ Index ]
This software may produce flashing lights, which can trigger seizures in individuals with photosensitive epilepsy. Please exercise caution if you or anyone who may be exposed to the lights has a history of epilepsy or seizures.
The use of emergency lights and/or siren sounds may be inappropriate or illegal in certain situations or locations. Users are responsible for ensuring compliance with local laws and regulations and must use this code responsibly. Use this software at your own risk. The author disclaims all responsibility for any misuse or adverse effects resulting from the use of this software.
Have another idea? Share it here. You can also fork this repo and submit a pull request with your own effect or animation! I'd love to see what you come up with.
[ Index ]
First make sure you have this repo cloned to your computer. If you don't have Git installed, you can download the repo as a ZIP file by clicking the green "Code" button at the top of this page. Follow the steps below to run the Python scripts in this repository on your Raspberry Pi Pico with the Pimoroni Unicorn Pack:
-
Similar to how you install the Pimoroni custom software to a Raspberry Pi Pico (official guide), you need to install the .uf2 file for the Pimoroni Galactic Unicorn. You can find the .uf2 file on the Pimoroni GitHub Release Page where the file is generally named starting with "galactic_unicorn...".
-
Download and install the Thonny IDE from the official website.
This allows us to write and run Python code on the Galactic Unicorns Raspberry Pi Pico.
-
Open Thonny and connect your Galactic Unicorns Raspberry Pi Pico to your computer using a USB cable.
-
On the left hand side you should see the file explorer for your Galactic Unicorns Raspberry Pi Pico. Drag and drop all the files from the
scripts
folder in this repository to the root directory of your Galactic Unicorns Raspberry Pi Pico. -
Unplug and replug your Galactic Unicorn to restart the device or press the "Reset" button on the back.
The file main.py
will automatically run when the Galactic Unicorn is powered on.
[ Index ]
Some views may require you to have Wi-Fi connected to your Raspberry Pi Pico. Follow the steps below to connect your Raspberry Pi Pico to Wi-Fi:
-
After copying the options.json (see User Options below for more information) file to the root directory of your Raspberry Pi Pico, open the file in Thonny or another IDE.
-
Add your Wi-Fi SSID and password to the
wifi_ssid
andwifi_password
objects in theoptions.json
file. Example:{ "wifi_ssid": "MY_WIFI_SSID", "wifi_password": "MY_WIFI_PASSWORD", ... }
Connecting to Wi-Fi is optional and only required for views that need internet access.
[ Index ]
The options.json
file contains user options that can be modified to customize the software or add additional functionality. The following options are available:
Option | Default Value | Description |
---|---|---|
wifi_ssid |
"" |
The SSID of your Wi-Fi network. |
wifi_password |
"" |
The password of your Wi-Fi network. |
stocks_finnhub_api_key |
"" |
A FinnHub API Key for fetching current stock prices. |
stocks_symbols |
["NVDA", "AMD", "MSFT", "GOOGL"] |
A list of up to 4 stock symbols. |
stocks_update_after_x_scrolls |
3 |
The number of scrolls before updating stock prices. |
stocks_update_message |
true |
Display a message while updating stock prices. |
time_zone |
"America/Chicago" |
The default time zone for the digital clock views. |
[ Index ]
|===========================================|
| (A) oooooooooooooooooooooooooooooooo (V+) |
| (B) oooooooooooooooooooooooooooooooo (V-) |
| (C) oooooooooooooooooooooooooooooooo (Zz) |
| (D) oooooooooooooooooooooooooooooooo (L+) |
| oooooooooooooooooooooooooooooooo (L-) |
|===========================================|
Button | Action |
---|---|
"A" | Next view/scene. |
"B" | Previous view/scene. |
"C" | Varies by view/scene. |
"D" | Varies by view/scene. |
"V+" | Increase volume. |
"V-" | Decrease volume. |
"Zz" | Sleep or Awaken. |
"L+" | Increase brightness. |
"L-" | Lower brightness. |
Button | Action |
---|---|
"C" | Cycle text color to previous. |
"D" | Cycle text color to next. |
"V+" | Manually update time, add minutes. |
"V-" | Manually update time, subtract minutes. |
Button | Action |
---|---|
"C" | Cycle text color to previous. |
"D" | Cycle text color to next. |
"V+" | Manually update time, add minutes. |
"V-" | Manually update time, subtract minutes. |
Button | Action |
---|---|
"C" | Increase stript width. |
"D" | Decrease stript width . |
Button | Action |
---|---|
"C" | Cycle text color to previous. |
"D" | Cycle text color to next. |
Stocks display view setup:
-
Be sure your Wi-Fi is connected, by following the Wi-Fi setup instructions here.
-
Sign up for a free API key (a place to get stock data) at Finnhub.io.
-
Add the API key to the
stocks_finnhub_api_key
object in theoptions.json
file. Example:{ "stocks_finnhub_api_key": "MY_API_KEY" }
-
Add up to 4 stock symbols to the
stocks_symbols
list in theoptions.json
file. Example:{ "stocks_symbols": ["NVDA", "AMD", "MSFT", "GOOGL"] }
-
See more options in the User Options section.
[ Index ]
-
Make sure you have Python installed on your computer (3.8+). You can download Python from the official website.
-
Run the following in a terminal at the root of this repository to install development dependencies:
# Install the required packages
python3 -m pip install -r requirements.txt
# Install the pre-commit hooks
pre-commit install
# Update the pre-commit hooks
pre-commit autoupdate
-
Make your code changes using Thonny, add new views, fix a bug, etc.
-
Test using Thonny by connecting your Raspberry Pi Pico to your computer. Run the
main.py
script or any view script individually by pressing the "Run" button with the file open. -
When your changes are in you can optionally run the following commands to lint and format your code:
# Format
python3 -m black scripts/
# Lint
python3 -m flake8 --show-source --ignore E501 scripts/
These scripts will also run automatically when you commit changes (pre-commit hooks) to ensure code quality.
- Submit a pull request with your changes.
[ Index ]
This project is licensed under the Apache License, Version 2.0. See the APACHE_2_LICENSE file for the pertaining license text.
SPDX-License-Identifier: Apache-2.0
[ Index ]
Thanks to all the people and projects that made this possible! I hope you enjoy this project as much as I enjoyed working on it. If you have any questions, please let me know by opening an issue here.
Type | Info |
---|---|
[email protected] | |
https://www.buymeacoffee.com/codytolene | |
bc1qfx3lvspkj0q077u3gnrnxqkqwyvcku2nml86wmudy7yf2u8edmqq0a5vnt |
Fin. Happy programming friend!
Cody Tolene