Hi Eur,

Eur van Andel wrote:

>> -- About cursor positions: the LCDs are internally 2x40 char devices.
>> -- The first line starts at offset 0, the second line at offset 64  
>> (0x40).
>> -- With a 4x16 or 4x20 LCD the third line starts at offset 20 and the
>> -- fourth line at offset 84 (0x40 + 20).
>> -- Note: Some 1x16 LCDs are implemented as 2x8 line LCDs, which  
>> means that
>> --       the second half of the line has to be handled as the  
>> second line.
> 
> How about:
> 
> const LCD_ROWS        = 4
> const LCD_CHARS       = 16
> 
> and procedures like:
> 
> lcd_row(n)
> 
> lcd_set_cursor_row_char(n,m)

These procedures won't be anything else than aliases of 
lcd_setcursor(n,0) and  lcd_setcursor(n,m).  I don't see any benefit, on 
the contrary, it would increase stack use which frightens some people.

And what would be the purpose of the constants when these are not used 
in the library?


> In my experience something like half(!) of JAL code is used for the  
> LCD human interface. Precise, easy-read cursor control saves lots of  
> time.
> 
> Just nod if you agree, I'll put it in. And yes, above constants  
> should be in the main program.
> 
>> -- With a 4x16 or 4x20 LCD the third line starts at offset 20 and the
>> -- fourth line at offset 84 (0x40 + 20).
> 
> Actually, it starts at offset 16 and 0x40+0x0A with a 4x16 LCD :-(

I didn't know! I have no 4x16 lcd, tested only with a 4x20 lcd. And now 
I see where your constants fall in place!

I'll make the changes and you may test it on a 4x16 lcd!

Regards, Rob.

-- 
Rob Hamerling, Vianen, NL (http://www.robh.nl/)

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"jallib" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/jallib?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to