Skip to content

Files

Latest commit

7c9ca67 · Sep 9, 2024

History

History

I2C_LCD1602

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
Feb 21, 2020
Feb 21, 2020
Sep 9, 2024
Sep 8, 2024

I2C LCD1602 MicroPython drive

main feathur

  • display text in I2C LCD1602
  • LCD display on/off
  • LCD backlight on/off
  • LCD display shfit left/right

ChangeLog

2020.2 ver 2.0

  • add autoaddress() function
  • add print() function
  • show object in puts() function

2018.2 ver 1.0

  • Initial version

internal signal

LCD1602 PCF8574A
RS P0
RW P1
E P2
BackLight P3
Dat P4-P7

I2C Address

PCF8574 PCF8574A
0x27 0x3F

API

  • on()
    turn on LCD

  • off()
    turn off LCD

  • clear()
    clear display

  • backlight(on)
    0 turn of backlight
    1 turn on backlight

  • char(ch, x, y)
    I2show a character in given position
    x, 0-15
    y, 0-1

  • puts(s, x, y)
    show string/object in given position
    x, 0-15
    y, 0-1

  • print(s) print to LCD, auto wrap and scroll in line end.

example

copy mp_i2c_lcd1602.py to pyboard first.

from machine import I2C, Pin
from mp_i2c_lcd1602 import LCD1602
from time import sleep_ms

i2c = I2C(1, sda=Pin(9), scl=Pin(10))

LCD = LCD1602(i2c)

LCD.puts("I2C LCD1602")

From microbit/micropython Chinese community.
www.micropython.org.cn