Pimoroni Galactic Unicorn Hello World: Difference between revisions
(→Fonts) |
|||
Line 66: | Line 66: | ||
* Bouncing ball: https://www.instructables.com/Galactic-Unicorn-Bounce-Simple-GFX-Demo/ | * Bouncing ball: https://www.instructables.com/Galactic-Unicorn-Bounce-Simple-GFX-Demo/ | ||
* | * | ||
== Physically modeled fire == | |||
See https://www.youtube.com/watch?v=bRXrL-8CTmg for a simple idea of a flame. |
Revision as of 18:59, 24 October 2023
Introduction
583 RGB leds in 53x11 grid. Raspberry Pi Pico W (microcontroller), speaker with amplifier, two (2) I2C Stemma/qt sensor sockets (3 or 4 pin JST PH), a light sensor (phototransistor) facing front and nine (9) control buttons, a reset button, JST-PH battery connector.
Connecting
2 x QW/ST Connections (4 pin 1.00 mm pitch Stemma QT / Qwiic)
- Stemma is Adafruit's [three or four pin JST PH with 2.00 mm pitch. The three pin for analog IO devices and four pin is for I2C.] Stemma QT is a smaller version of the four pin Stemma format, with a 1.0 mm pitch, and is only for I2C.
- Qwiic is Sparkfun's connector type
The buttons and the QW/ST connectors are the only means to interface with Galactic Unicorn, and Wifi of course. It is possible to get StemmaQT to male jumper wire adapters for use with I2C devices or for basic GPIO access.
More information
- https://github.com/nickgammon/I2C_Anything
- https://arduino.stackexchange.com/questions/16292/sending-and-receiving-different-types-of-data-via-i2c-in-arduino
Programming
Raspberry Pi Pico can be programmed using Micropython or C/C++. This will deal only with MicroPython.
To upload your file to Pico, it need to be put into bootloader mode: hold down the bootsel button while plugging the USB cable: it should show up as a drive called RPI-RP2.
IDE's
- Thonny is the da facto
- VS Studio: MicroPico (the id is paulober.pico-w-go). If not found use this https://github.com/microsoft/vscode/issues/108147 because some Linux distros use OpenVSX.
Thonny
- Connect the USB cable while bootsel button is pressed: RPI-RP2 is found on device manager.
- Copy the pimoroni-galactic_unicorn-v1.20.6-micropython.uf2 to RPI-RP2.
- Start thonny; see the right down corner that correct device is connected.
- Program.
- Run/ Stop / Load.
Micropython
Some libraries are needed. Download from https://github.com/pimoroni/pimoroni-pico/releases
from picographics import PicoGraphics, DISPLAY_GALACTIC_UNICORN
Manual: PicoGraphics
from galactic import GalacticUnicorn
Manual: GalacticUnicorn
from machine import Pin, I2C
Text and Fonts
Stationary, centred, scrolling text.
Font library
Nice 5x3 characters: https://forums.pimoroni.com/t/galactic-unicorn-small-numeric-characters/20766
Sound
Effects
Physically modeled fire
See https://www.youtube.com/watch?v=bRXrL-8CTmg for a simple idea of a flame.