Hello,
I am trying to "dim up" my Adafruit 1.44'' TFT display on power-up, using an Atmega1284P-PU's PWM function, i.e. the "Lite" pin of the display is connected to pin 15 of the Atmega.
For the most part, this is working quite well with the following code (irrelevant parts of code omitted):
void setup() {
pinMode(displayDimmer, OUTPUT);
analogWrite(displayDimmer, 0);
//Preparing Welcome Screen
bmpDraw("mg-welc.bmp", 0, 0);
// Welcome Screen Fade In and Fade out
int disp = 0;
while (disp <= 255) {
analogWrite(displayDimmer, disp);
delay(15);
disp ++;
}
delay(5000);
while (disp >= 0) {
analogWrite(displayDimmer, disp);
delay(5);
disp --;
}
delay(1000);
tft.fillScreen(ST7735_WHITE);
analogWrite(displayDimmer, 255);
}
}
But the problem is that when I first power up the Atmega1284, it starts with a brightly lit white screen (with nothing on it). I'd really like to have it so that it immediately starts with just a completely black screen at power-up, and then the welcome logo fades in.
How can I achieve that?