a. Display Brightness

<< Click to Display Table of Contents >>

Navigation:  Tutorials > Tutorial 15 - Device Control >

a. Display Brightness

This section shows how to adjust the display brightness using the Display() command.

 

 

Command Prototype

 

int16_t Display(int16_t On);

 

Parameters

Description

On

255 indicates high brightness, 0 indicates low brightness

 

 

Code

 

 

void setup()

{

/* Initialize CleO - needs to be done only once */

 CleO.begin();

 

/* Start building a screen frame */

 CleO.Start();

 CleO.SetBackgroundcolor(WHITE);

 CleO.StringExt(FONT_MEDIUM, 400, 240, BLACK, MM, 0, 0, "Brightness - 100%");

 

/* Display completed screen frame */

 CleO.Show();

 

 delay(1000);

 

/* Start building a screen frame */

 CleO.Start();

 CleO.SetBackgroundcolor(WHITE);

 CleO.StringExt(FONT_MEDIUM, 400, 240, BLACK, MM, 0, 0, "Brightness - 10%");

/* Display completed screen frame */

 CleO.Show();

 

/* set brightness to 10% */

 CleO.Display(255 / 10);

 delay(3000);

 

/* Start building a screen frame */

 CleO.Start();

 CleO.StringExt(FONT_MEDIUM, 400, 240, BLACK, MM, 0, 0, "Brightness - 100%");

 

 /* Display completed screen frame */

 CleO.Show();

/* set brightness to 100% */

 CleO.Display(255);

}

 

 

Description

 

The above setup routine shows 100% brightness and then pauses for 1 second and switches to 10% brightness, pause for 3 seconds and displays again 100% brightness.

 

 

Output

 

Here is the output displayed upon executing the above code snippet -

 

Brightness10

Brightness100