LCD[0] - LCD[3]
Allows the use of an LCD display(s) equipped with an HD44780 or compatible chip. Can be used directly or with I2C interface. Select the Parallel / I2C mode in the Setup/Peripheral menu, set the SCL and SDA pins for I2C, and specify the interface address, which can be modified by crossing the A0, A1, A2 sources on the panel, default: 27. Device addresses on the bus are visible in the serial terminal during boot.
Parallel connection:
LCD | WeMos |
GND | GND |
Vcc | 5V |
Vee | Contrast |
RS | D3 |
R/W | GND |
E | Setup E |
D4 | D0 |
D5 | D5 |
D6 | D6 |
D7 | D7 |
Contrast can be adjusted with the Vee pin. Usually good when connected to GND. If not, it can be adjusted with a potentiometer or using the Contrast GPIO set in the Setup menu. For backlight, a serial resistor of ~56Ω is recommended. For multiple displays, apart from the E pin, the others should be connected in parallel. Most displays do not operate with Vcc at 3.3V.
LCD[0](CLR)
Clears the display.
LCD[0](L,0)Left
Writes to the first row aligned to the left.
LCD[0](L3,0)Left3
Writes to the first row aligned to the left with a 3-character margin.
LCD[0](&L9,0)rewrite
Writes onto the first row aligned to the left.
LCD[0](R,0)Right
Writes to the first row aligned to the right.
LCD[0](C,0)Center
Writes to the first row centered.
LCD[0](C,1)Line 2
Writes to the second row centered.
LCD[0](CLR,C,0)Clean screen
Clears the display and writes to the first row centered.
LCD[0](CLR,L,0)Á É Í Ó Ö Ő Ú Ü
LCD[0](CLR,L,0)Ű á é í ú ü ó ö
LCD[0](CLR,L,0)ő ű Æ à â å Ç ç
LCD[0](CLR,L,0)Ë è ê ë î Ø Ò Õ
LCD[0](CLR,L,0)ò õ ø û ù æ ß Â
LCD[0](CLR,L,0)Ä Å Î č Č Ğ ğ Đ
LCD[0](CLR,L,0)đ İ ı Š š Ş ş Ž
LCD[0](CLR,L,0)ž Ș ș Ț ț °
Accented characters.
Up to 8 different accented/custom characters can be used at once! To use different special characters than the previous eight, you need to clear the display before displaying.
LCD[0](CLR,L,0)%0 %1 %2 %3 %4 %5 %6 %7
LCD[0](CLR,L,0)%8 %9 %A %B %C %D %E %F
LCD[0](CLR,L,0)%G %H %I %J %K %L %M %N
LCD[0](CLR,L,0)%O %P %Q %R %S %T %U %V
LCD[0](CLR,L,0)%W%X|
LCD[0](L,1)%Y%Z
Custom characters.
Custom characters can be stored in the LCD.txt file. You can create the desired character on the https://maxpromer.github.io/LCD-Character-Creator
website or on graph paper with a square grid.
5 columns, 7 or 8 rows, depending on the type of display.
Example LCD.txt:
0:
B00000
B00100
B01110
B11111
B01110
B00100
B00000
B00000
#
1:
B00100,
B00010,
B00100,
B01000,
B00100,
B00010,
B00100,
B00000
#
LCD[0](ON)
Turns on the backlight. Works only with I2C panels.
LCD[0](OFF)
Turns off the backlight. Works only with I2C panels.
LCD[0](RST)
Resets the display.
LCD[0]@
Sends the display parameters to STDOUT.