LCD print position

setCursor 0, 0 print at beginning of line hello
setCursor 0, 1 print at beginning of line hello
setCursor 0, 2 print 4 positions down the line hello
setCursor 0 ,3 print 4 positions down the line hello

16x4 display. Why the spaces on line 3 and 4 ?

  • Please show us the sketch.

Are you using GitHub - duinoWitchery/hd44780: Extensible hd44780 LCD library

1 Like

LCD.clear();
LCD.setCursor(0, 0);
LCD.print("Chiller ");
LCD.setCursor(9, 0);
LCD.print(temp1, 1);

LCD.setCursor(0, 1);
LCD.print("Freezer 1 " );
//LCD.setCursor(10, 1);
//LCD.print(temp1, 1);

LCD.setCursor(0, 2);
LCD.print("Freezer 2 " );
LCD.setCursor(10, 2);
LCD.println(temp3, 1);

LCD.setCursor(0, 3);
LCD.print("Freezer 3 " );
//LCD.setCursor(10, 30);
//LCD.println(temp4, 1);

sensor 2, 3 and 4 not connected and using LiquidCrystal_I2C

line 1 and 2 is fine but 3 and 4 start leading 4 spaces but cursor set to start at 0

could the lcd display be faulty? Even just a simple code to print hello world on line 3 from position 0 starts 4 spaces down the line. Could it be the library? Corrupt?

Read post #3 ...

(and probably also this link: https://forum.arduino.cc/t/problems-with-16x4-lcd-i2c-interface/480283/2 )

It looks as if the library you are using doesn't fit to the hardware ...

suspect that too.

There is a "quick but dirty" solution in the link

      lcd.setCursor(0, 0);
      lcd.print("row one");
      lcd.setCursor(0, 1);
      lcd.print("row two");
      lcd.setCursor(-4, 2);
      lcd.print("row three");
      lcd.setCursor(-4, 3);
      lcd.print("row four");

Just to check if it's the different memory organisation of your lcd.

However, I highly recommend to check @DaveX 's post!

thanks..the -4 helps me out for now.

Oh my dear, I was afraid you'll say that ... :wink:

However. if you are interested in some background on LCD addressing issues:

https://web.alfredstate.edu/faculty/weimandn/lcd/lcd_addressing/lcd_addressing_index.html

Good luck (and better use the appropriate lib!)
ec2021

i will try hd44780. Great and fast support! THANK YOU

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.