r/raspberrypipico • u/shapoco • 1d ago
c/c++ Sunset-toned animation on a monochrome STN LCD with a Pico
I made a sunset-toned animation on a TG12864B monochrome STN LCD driven by a Raspberry Pi Pico (RP2040).
Showing intermediate tones by rapidly toggling pixels on and off (known as frame rate control, or temporal dithering) is nothing new. But on a blue-background STN LCD, pixels pass through purple and yellow hues while switching between dark and light. I use that to display images in a nostalgic color palette.
The Pico generates an individual PDM signal for each of the 128x64 pixels, which gives 256 levels per pixel.
At first the screen was covered in sand-like noise. While trying different refresh rates, I found that the noise almost disappears at one specific frame rate (102-103 FPS for this module). I'm not sure why, but it seems to sync with some periodic operation inside the LCD module.
The 3D scene is also rendered on the Pico.
GitHub repo: https://github.com/shapoco/pdmfrc
