Hello,
I've used this module with 4x20 LCD and it worked OK, now I'm using it in very similar project but with 4x16 LCD. I have a very strange problem when setting cursor to line 3 or 4, i get strings shifted 4 columns to the right.
EDIT:
this is part of my B4R code:
I tried this Arduino IDE code and gave me same result
any idea how to solve this problem?
Thanks
I've used this module with 4x20 LCD and it worked OK, now I'm using it in very similar project but with 4x16 LCD. I have a very strange problem when setting cursor to line 3 or 4, i get strings shifted 4 columns to the right.
EDIT:
this is part of my B4R code:
B4X:
PutString(0,0,DayOfWeekArr(DayOfWeek - 1),False)
'PutString(0,0,DayOfWeekArr(DayOfWeek-1),False)
PutString (4,0,NumberFormat(Years,4,0),False)
PutString (8,0,"-",False)
PutString (9,0,NumberFormat(Months,2,0),False)
PutString (11,0,"-",False)
PutString (12,0,NumberFormat(DayOfMonth,2,0),False)
PutString (5,1,NumberFormat(Hours,2,0),False)
PutString (7,1,":",False)
PutString (8,1,NumberFormat(Minutes,2,0),False)
PutString (10,1,":",False)
PutString (11,1,NumberFormat(Seconds,2,0),False)
PutString (0,3,SigningArray(SigningMode-1),False)
PutString (4,3,ReasonCodeArray(ReasonCode-1),False)
PutString (8,3,LoadTypeArray(LoadType-1),False)
PutString (11,3,RFIDmodeArr(RFIDmode-1),False)
B4X:
Sub PutString(Col As Byte, Row As Byte, PrnString As String,Center As Boolean)
Dim Ln As Byte = PrnString.Length
Dim Xcol As Byte
If Center Then
Xcol = (SYS_LCD_COLUMNS-Ln) / 2 'if print string centered, get center column
Else
Xcol = Col
End If
LCD.SetCursor(Xcol,Row)
LCD.Write(PrnString)
End Sub
I tried this Arduino IDE code and gave me same result
B4X:
//YWROBOT
//Compatible with the Arduino IDE 1.0
//Library version:1.1
#include <Wire.h>
#include <LiquidCrystal_I2C.h>
LiquidCrystal_I2C lcd(0x27,16,4); // set the LCD address to 0x27 for a 16 chars and 4 line display
void setup()
{
lcd.init(); // initialize the lcd
lcd.init();
// Print a message to the LCD.
lcd.backlight();
lcd.setCursor(0,0);
lcd.print("Hello, world!");
lcd.setCursor(0,1);
lcd.print("Arduino!");
lcd.setCursor(1,2);
lcd.print("Arduino");
lcd.setCursor(1,3);
lcd.print("Mostez");
}
void loop()
{
}
any idea how to solve this problem?
Thanks
Last edited: