2.4 KiB
WelcomeScreen
A simple library providing a customizable welcome screen fading over an LCD. Running on a Raspberry Pi Pico.
For execution at startup of any kind of device, for a nice and user-friendly startup!
Support for both 2x16 and 4x20 LCD displays with an I2C backpack (PCF8574T used for development).
How it looks
If you create an instance of the WelcomeScreen class (the only class brought to you by this library), you have several options to make WelcomeScreen adapt to your needs.
The default behaviour though is the following: First, the string "Starting..." fades over the display in the first/second row (depending on whether the LCD has 2 or 4 lines) one time. In the second/third row, there's a persistent sample text which can easily replaced (e.g. with your device's name, it's function, ...) if you want to.
After that, the whole text displayed is faded out to the bottom, and the flow goes back to whereever the screen has been started.
What it needs
This library is nearly standalone, but it depends on a LCD library for displaying it's content. I used the PCF8574T library for this.
For the examples to work, follow this Wiring:
Device Pin | Pi Pico Pin |
---|---|
Interrupt BTN Pin 1 | 3.3V |
Interrupt BTN Pin 2 | GPIO14 |
Interrupt SWITCH Pin 1 | 3.3V |
Interrupt SWITCH Pin 2 | GPIO15 |
LCD SDA | GPIO8 |
LCD SCL | GPIO9 |
LCD GND | GND |
LCD VCC | 5V |
How to use it
There are examples which can be found in the examples folder. For basic usage, you just have to create an LCD object, use it to create a WelcomeScreen object and run the show() method!
from WelcomeScreen import WelcomeScreen
from machine import I2C, Pin # micropython's built-in library
from PCF8574T import I2C_LCD # https://git.privacynerd.de/BlueFox/micropython-libraries/src/branch/main/PCF8574T
LCD = I2C_LCD(I2C(0, sda=Pin(8), scl=Pin(9), freq=400000), 0x27, 2,16)
ws = WelcomeScreen(LCD).show()
lcd.putstr("Now your program")
For extended usage, in the WelcomeScreen.py file you can find a more detailed listing of what parameters exist, how to use them and what they do.
License
This project is licensed under GPL-3.0-or-later. See LICENSE.