User Tools

Site Tools


en-us_commands:reference:iclcdtextdirection

IclcdTextDirection()

IclcdTextDirection() sets the text entry direction.

IclcdTextDirection command operation flow

bool IclcdTextDirection(bool leftToRight = true, uint8_t device = 0)

Commands

Command Arguments Return Value Operation
IclcdTextDirection(leftToRight, device) bool leftToRight = true
uint8_t device = 0
bool Sets the text entry direction.

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.
  if (lcdReady) {
    IclcdTextDirection(false);  // Write text from right to left.
    IclcdPrint(F("ABC"));  // Display text to observe the operation.
  }
}
 
void loop() {}

Precautions

  • PCF8574 connections use the same mapping as the existing CLCD library: P0=RS, P1=R/W, P2=Enable, P3=backlight, P4~P7=LCD D4~D7.
  • Verify the LCD module's actual I²C address using its settings and I²C scan results.
  • SDA/SCL can share the bus with other I²C devices, but addresses must not overlap.
  • Do not run Wire transfers or I²C slave callbacks concurrently with Iclcd…(). Iclcd transfers run at 100 kHz and then restore the previous TWI settings.
  • On MPAINO, using D20/D21 for external interrupts prevents simultaneous I²C use.
  • IclcdCommand() can change the LCD state directly. Use it only if you understand HD44780 commands.

Built-in Commands in the Same Category

en-us_commands/reference/iclcdtextdirection.txt · Last modified: by 127.0.0.1

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki