uLCD Screensaver
Overview
This is an extension to the 4DGL-uLCD-SE library. By utilizing the mbed RTOS, the uLCD enters and exits screensaver mode based on a refresh timer. The screensaver thread saves the previous contents of the LCD screen before playing an animation.
Heavy modifications were made to many files within the original 4DGL-uLCD-SE library. For this reason we have elected to include a simple import program option, rather than posting raw code. The largest modification is the addition of the uLCD_Screensaver.cpp file, which contains the core functionality of the program.
uLCD_Screensaver.cpp monitors LCD uptime to determine when to enter screensaver mode. Upon entering screensaver mode, the current screen state is saved and an animation plays. After the 'refresh' pushbutton is pressed, the animation halts and the previous screen state is rewritten to the LCD.
Existing issues:
- Color accuracy is limited by the existing uLCD class. Currently, the read_pixel() method returns a 16 bit color value, where pixel() uses a 24 bit color value to write.
- Performance is limited by lack of RAM. Because of this, the method that saves the screen state before playing the animation can take a large amount of time. The workaround involves saving the screen state into a text file on an SD card and reading from that file to restore.
Components Required
Wiring
uLCD
Component pin | mbed pin |
---|---|
+5V | VU |
RX | p27 |
TX | p28 |
GND | GND |
RES | p30 |
Pushbutton
Component pin | mbed pin |
---|---|
High | p21 |
Low | GND |
microSD Breakout
Component pin | mbed pin |
---|---|
CS | p8 |
DI | p5 |
VCC | VOUT |
SCK | p7 |
GND | GND |
DO | p6 |
Project
Import programuLCD_screensaver
screensaver extension to uLCD
Import library4DGL-uLCD-SE
Extended library to include a screensaver
Demonstration
Please log in to post comments.