Table of Contents

IclcdBacklight()

IclcdBacklight() turns the LCD backlight on or off.

IclcdBacklight command operation flow

bool IclcdBacklight(bool on = true, uint8_t device = 0)

Commands

Command Arguments Return Value Operation
IclcdBacklight(on, device) bool on = true
uint8_t device = 0
bool Turns the LCD backlight on or off.

Example

This example connects a 20×4 PCF8574 character LCD at address 0x27 to the MPAINO-8A8R(T) I2C port. Change the IclcdBegin() arguments if your LCD has a different address or size.

bool lcdReady = false;
 
void setup() {
  lcdReady = IclcdBegin(0x27, 20, 4);  // Set the LCD address and display size.
}
 
void loop() {
  if (!lcdReady) return;
  IclcdBacklight(false);  // Turn the LCD backlight on or off.
  delay(1000);
  IclcdBacklight(true);  // Turn the LCD backlight on or off.
  delay(1000);
}

Precautions

Built-in Commands in the Same Category

← Built-in Command List