Can the display format be changed at runtime. I am writing code for a serial LCD display and want a command to change the format (geometry: 4x20, 2x16, etc. ) at reset.
Can the display format be changed at runtime.
Basically there is no technique or need to do this unless you are dealing with some of the 16x1 displays. The same controller is used regardless of the display geometry and there is no way to inform the controller what kind of device it is controlling! Also, with the exception of some 16x1 displays, the controller initialization is the same for all geometries.
The only reason that a library such as the LiquidCrystal library needs information about the display geometry is so that it can convert 'row and column' information into the specific memory address required by the particular display being used. If you want more background information about this then follow the LCD Addressing link at http://web.alfredstate.edu/weimandn.
Don
Which brand serial LCD and why do you want to set it to a different display size?
liudr:
Which brand serial LCD and why do you want to set it to a different display size?
My guess would be that it is for a "backpack" type implementation/product and the exact display
connected to it is not known up front and potentially needs to be changed from a default setting.
rinthesun.
To tell the library about the dimensions of the display all you need to do is call begin()
with the desired parameters. This will set up the internal variables in the library and
also re-initialize the lcd. From looking at the code, it can be called multiple times, including
with different parameters and should do what you seem to be asking for.
--- bill
---bill
I am writing Arduino code to emulate the PH Anderson serial LCD. There is a command to change geometry while code is running. It is mainly used to track cursor position. In using the LiquidCrystal library, I don't want to clash with whatever the library is doing. I understand the the standard library handles 80 characters, 20x4, 40x2. I also understand that there is an extended LCD library.
I have written such code before in Oshonsoft Basic for the PIC 16F886 with good results and now I want to do it with the Arduino (Atmega328P).
There is a command to change geometry while code is running. It is mainly used to track cursor position.
This agrees with what I said in reply #1.
In using the LiquidCrystal library, I don't want to clash with whatever the library is doing.
Could you explain what the LiquidCrystal library has to do with this since you are writing code for a serial interface.
I have written such code before in Oshonsoft Basic for the PIC 16F886 with good results and now I want to do it with the Arduino (Atmega328P).
This should be almost trivial since this means that you have already figured out how to interpret and implement the HD44780 command set.
Don