Sets the brightness of the LCD backlight.

Syntax

int BackLightLvl(
  int bl_level
);

Parameters

bl_level
[in] Specifies the brightness of the LCD backlight.
ValueDescription
LCD_LEVEL1 Lowest brightness
LCD_LEVEL2 Level 2
LCD_LEVEL3 Level 3
LCD_LEVEL4 Level 4
LCD_LEVEL5 Highest brightness.
CURRENT_MODE Do not change the settings.

Return value

Returns the changed setting.

Remarks

Sets the brightness of the LCD backlight.

Requirements

Header file:
lib.h
Library file:
libSTARTUPOPH5000.a

Sample

#include <stdio.h>
#include "lib.h"


void main(void)
{
    int lv[5] = {LCD_LEVEL1, LCD_LEVEL2, LCD_LEVEL3, LCD_LEVEL4, LCD_LEVEL5};
    int lvIndex;
    printf("[BackLightLvl]\n");
    printf("Please any key\r");
    ResetKey();
    while(!kbhit())
        Idle();
    for (lvIndex = 0; lvIndex < 5; lvIndex++)
    {
        printf("bl_level:%d\nPlease any key\r",lv[lvIndex]);
        BackLightLvl(lv[lvIndex]);
        ResetKey();
        while(!kbhit())
            Idle();
    }
}

Last updated: 2022/04/08