I have a genuine Arduino Nano and a genuine Waveshare 1.47" LCD. They are connected exactly like shown in Waveshare's wiki, except the LCDs VCC is connected to 5V instead of 3.3V.
Now if I power-on the Arduino and the display by plugging the Arduino into a USB port, and then initialize the display, the display buffer is filled with random noise, so I need to fill it with black pixels to remove said noise:
#include <Adafruit_ST7789.h>
Adafruit_ST7789 lcd(10, 7, 8);
void setup() {
lcd.init(172, 320);
lcd.fillScreen(ST77XX_BLACK);
}
AFAIK that noise is normal. I also had it using an SSD1309 128x64 monochrome OLED display, so I never questioned it. But since the Waveshare display is of much higher resolution (172x320) and also full-color, filling the screen takes much more time. And as such, for a fraction of a second, that noise is visible to the human eye. Aesthetically, that's not very pleasing. So to hide that noise, I set the display brightness to 0% and back to 100% after init()
and fillScreen()
:
pinMode(9, OUTPUT);
analogWrite(9, 0);
lcd.init(172, 320);
lcd.fillScreen(ST77XX_BLACK);
analogWrite(9, 255);
That kinda works. The noise is now invisible. But now the screen is flickering at every power-on, because:
- Power-on: Brightness from 0% to 100%.
- Before init: Brightness from 100% to 0%.
- After screen filling: Brightness from 0% to 100%.
Tbh, this isn't much prettier. My preferred solution would be to start the display at 0% brightness, e.g. by defaulting to 0% PWM duty cycle on the backlight pin. But I have no idea how to do this of if this is even possible. Any hints or alternatives?