Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for LOGO display 10x4 #12

Open
deHarro opened this issue Dec 30, 2022 · 0 comments
Open

Support for LOGO display 10x4 #12

deHarro opened this issue Dec 30, 2022 · 0 comments

Comments

@deHarro
Copy link

deHarro commented Dec 30, 2022

Hi Francisco!

I use some of those LOGO displays offered by Pollin here in germany as HB10401 (see https://www.pollin.de/p/lcd-modul-hb10401-4x10-121148).
The application I use one of it is described on my hompage.
(It's written in german. At the bottom of the page I added a translation feature (Google translate)).

To get your library up and running with those displays, one has to add a few lines of code in "LCD.cpp" to make the cursor positioning follow the somewhat different screen layout of the HB10401:

// 2017.10.18 deharry - add support for SIEMENS LOGO display, 10x4 chars (see "row_offsetsSpecial")
...

void LCD::setCursor(uint8_t col, uint8_t row)
{
   const byte row_offsetsDef[]   	= { 0x00, 0x40, 0x14, 0x54 }; // For regular LCDs
   const byte row_offsetsSpecial[]	= { 0x00, 0x40, 0x0A, 0x4A }; // For LOGO Display	<<< add this line
   const byte row_offsetsLarge[] 	= { 0x00, 0x40, 0x10, 0x50 }; // For 16x4 LCDs

   if ( row >= _numlines )
   {
	  row = _numlines-1;    // rows start at 0
   }

   // 16x4 LCDs have special memory map layout
   // ----------------------------------------
   if ( _cols == 16 && _numlines == 4 )
   {
	  command(LCD_SETDDRAMADDR | (col + row_offsetsLarge[row]));
   }
   // LOGO Display (10x4) has special memory map layout						<<< add this line
   else if ( _cols == 10 && _numlines == 4 )	// LOGO Display					<<< add this line
   {												<<< add this line
	  command(LCD_SETDDRAMADDR | (col + row_offsetsSpecial[row]));				<<< add this line
   }												<<< add this line
   else
   {
	  command(LCD_SETDDRAMADDR | (col + row_offsetsDef[row]));
   }
}

You may add these lines to your lib to support this sort of displays out of the box.
Thanks!
Harry

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant