Table of Contents

IclcdClear()

IclcdClear() clears the LCD screen.

IclcdClear command operation flow

bool IclcdClear(uint8_t device = 0)

Commands

Command Arguments Return Value Operation
IclcdClear(device) uint8_t device = 0 bool Clears the LCD screen.

Example

This example uses a PCF8574 character LCD at I²C address 0x27. Send c from Serial Monitor to clear the text on the display.

bool lcdReady = false;
 
void setup() {
  Serial.begin(115200);
  lcdReady = IclcdBegin(0x27, 20, 4);  // Initialize the LCD and check the connection.
  if (!lcdReady) {
    Serial.println(F("LCD not found"));
    return;
  }
  IclcdPrint(F("Press c to clear"));  // Show text before clearing the display.
}
 
void loop() {
  if (!lcdReady || !Serial.available()) return;
  if (Serial.read() != 'c') return;
  if (IclcdClear()) {  // Clear the LCD screen.
    Serial.println(F("LCD cleared"));
  }
}

Precautions

Built-in Commands in the Same Category

← Built-in Command List