This repository has been archived by the owner on Dec 20, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
start()
Mammad900 edited this page Aug 30, 2020
·
1 revision
Starts the TFT screen and renders the first page (page 0)
None
Nothing
void setup(){
addlabel(0,CENTER,CENTER,"This is demo app",TFT_WHITE,&FreeSans9pt7b);
start();
}
After the TFT screen has started, you can see 'This is demo app' in the middle of the screen.
void start() {
pinMode(BACKLIGHT_PIN,OUTPUT); // Set the backlight pin as an output
tft.reset(); // Resets the TFT
uint16_t ID = tft.readID(); // Different TFT controllers may be used, this identifies the controller model
tft.begin(ID); // Inits the TFT screen
if(ID==0x9325) // This only works with ILI9325. for other controllers, you need a different command.
tft.WriteCmdData(0x2B, 0x000E); // Set frame rate to 112 fps. Used for better look in screen off animation Remember to change this low-level command to match your controller
delay(100); // Wait a little to rest the shield (may not affect anything)
tft.setRotation(Orientation); // Sets rotation to predefined value
tft.fillScreen(page_backColors[CurrentPage]); // Fills the screen with the firt page's color. Filling with black before it only wastes time.
navigatePage(0); // Draw the first page.
analogWrite(BACKLIGHT_PIN,brightness*BC); // Activate backlight
started=true;
}