{
  "id": "brainelectronics/micropython-i2c-lcd",
  "name": "micropython-i2c-lcd",
  "prettyName": "micropython-i2c-lcd",
  "description": "Micropython package to control HD44780 LCD displays 1602 and 2004 via I2C",
  "version": "",
  "author": "brainelectronics",
  "license": "MIT",
  "tags": [
    "hd44780",
    "hd44780-display",
    "i2c",
    "i2c-display",
    "lcd",
    "lcd1602",
    "lcd16x2",
    "lcd2004",
    "lcd20x4",
    "library",
    "micropython",
    "package"
  ],
  "status": "VALID",
  "official": false,
  "source": "https://github.com/brainelectronics/micropython-i2c-lcd",
  "updatedAt": "2026-10-16T07:00:01.005Z",
  "page": "https://checkmim.com/packages/brainelectronics+micropython-i2c-lcd",
  "createdAt": "2025-05-27T04:29:25.524Z",
  "submittedBy": "oliverr",
  "install": {
    "mpremote": "mpremote mip install github:brainelectronics/micropython-i2c-lcd",
    "mip": "import mip; mip.install(\"github:brainelectronics/micropython-i2c-lcd\")"
  },
  "readme": "# MicroPython I2C LCD\n\n[![Downloads](https://pepy.tech/badge/micropython-i2c-lcd)](https://pepy.tech/project/micropython-i2c-lcd)\n![Release](https://img.shields.io/github/v/release/brainelectronics/micropython-i2c-lcd?include_prereleases&color=success)\n![MicroPython](https://img.shields.io/badge/micropython-Ok-green.svg)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n[![codecov](https://codecov.io/github/brainelectronics/micropython-i2c-lcd/branch/main/graph/badge.svg)](https://app.codecov.io/github/brainelectronics/micropython-i2c-lcd)\n[![CI](https://github.com/brainelectronics/micropython-i2c-lcd/actions/workflows/release.yml/badge.svg)](https://github.com/brainelectronics/micropython-i2c-lcd/actions/workflows/release.yml)\n\nMicroPython package to control HD44780 LCD displays 1602 and 2004 via I2C\n\n---------------\n\n## General\n\nMicroPython package to control HD44780 LCD displays 1602 and 2004 via I2C\n\n📚 The latest documentation is available at\n[MicroPython I2C LCD ReadTheDocs][ref-rtd-micropython-i2c-lcd] 📚\n\n<!-- MarkdownTOC -->\n\n- [Installation](#installation)\n\t- [Install required tools](#install-required-tools)\n- [Setup](#setup)\n\t- [Install package with upip](#install-package-with-upip)\n\t\t- [General](#general)\n\t\t- [Specific version](#specific-version)\n\t\t- [Test version](#test-version)\n\t- [Manually](#manually)\n\t\t- [Upload files to board](#upload-files-to-board)\n- [Usage](#usage)\n- [Credits](#credits)\n\n<!-- /MarkdownTOC -->\n\n## Installation\n\n### Install required tools\n\nPython3 must be installed on your system. Check the current Python version\nwith the following command\n\n```bash\npython --version\npython3 --version\n```\n\nDepending on which command `Python 3.x.y` (with x.y as some numbers) is\nreturned, use that command to proceed.\n\n```bash\npython3 -m venv .venv\nsource .venv/bin/activate\n\npip install -r requirements.txt\n```\n\n## Setup\n\n### Install package with upip\n\nConnect the MicroPython device to a network (if possible)\n\n```python\nimport network\nstation = network.WLAN(network.STA_IF)\nstation.active(True)\nstation.connect('SSID', 'PASSWORD')\nstation.isconnected()\n```\n\n#### General\n\nInstall the latest package version of this lib on the MicroPython device\n\n```python\nimport mip\nmip.install(\"github:brainelectronics/micropython-i2c-lcd\")\n```\n\nFor MicroPython versions below 1.19.1 use the `upip` package instead of `mip`\n\n```python\nimport upip\nupip.install('micropython-i2c-lcd')\n```\n\n#### Specific version\n\nInstall a specific, fixed package version of this lib on the MicroPython device\n\n```python\nimport mip\n# install a verions of a specific branch\nmip.install(\"github:brainelectronics/micropython-i2c-lcd\", version=\"feature/initial-implementation\")\n# install a tag version\nmip.install(\"github:brainelectronics/micropython-i2c-lcd\", version=\"0.1.0\")\n```\n\nFor MicroPython versions below 1.19.1 use the `upip` package instead of `mip`\n\n```python\nimport upip\nupip.install('micropython-i2c-lcd==0.1.0')\n```\n\n#### Test version\n\nInstall a specific release candidate version uploaded to\n[Test Python Package Index](https://test.pypi.org/) on every PR on the\nMicroPython device. If no specific version is set, the latest stable version\nwill be used.\n\n```python\nimport mip\nmip.install(\"github:brainelectronics/micropython-i2c-lcd\", version=\"0.1.0-rc3.dev1\")\n```\n\nFor MicroPython versions below 1.19.1 use the `upip` package instead of `mip`\n\n```python\nimport upip\n# overwrite index_urls to only take artifacts from test.pypi.org\nupip.index_urls = ['https://test.pypi.org/pypi']\nupip.install('micropython-i2c-lcd==0.1.0rc3.dev1')\n```\n\n### Manually\n\n#### Upload files to board\n\nCopy the module to the MicroPython board and import them as shown below\nusing [Remote MicroPython shell][ref-remote-upy-shell]\n\nOpen the remote shell with the following command. Additionally use `-b 115200`\nin case no CP210x is used but a CH34x.\n\n```bash\nrshell --port /dev/tty.SLAB_USBtoUART --editor nano\n```\n\nPerform the following command inside the `rshell` to copy all files and\nfolders to the device\n\n```bash\nmkdir /pyboard/lib\nmkdir /pyboard/lib/lcd_i2c\n\ncp lcd_i2c/* /pyboard/lib/lcd_i2c\n\ncp examples/main.py /pyboard\ncp examples/boot.py /pyboard\n```\n\n## Usage\n\n```python\nfrom lcd_i2c import LCD\nfrom machine import I2C, Pin\n\n# PCF8574 on 0x50\nI2C_ADDR = 0x27     # DEC 39, HEX 0x27\nNUM_ROWS = 2\nNUM_COLS = 16\n\n# define custom I2C interface, default is 'I2C(0)'\n# check the docs of your device for further details and pin infos\ni2c = I2C(0, scl=Pin(13), sda=Pin(12), freq=800000)\nlcd = LCD(addr=I2C_ADDR, cols=NUM_COLS, rows=NUM_ROWS, i2c=i2c)\n\nlcd.begin()\nlcd.print(\"Hello World\")\n```\n\nFor further examples check the `examples` folder or the Example chapter in the\ndocs.\n\n## Credits\n\nBased on [Frank de Brabanders Arduino LiquidCrystal I2C Library][ref-arduino-lcd-i2c-library].\n\n<!-- Links -->\n[ref-rtd-micropython-i2c-lcd]: https://micropython-i2c-lcd.readthedocs.io/en/latest/\n[ref-remote-upy-shell]: https://github.com/dhylands/rshell\n[ref-arduino-lcd-i2c-library]: https://github.com/fdebrabander/Arduino-LiquidCrystal-I2C-library\n[ref-test-pypi]: https://test.pypi.org/\n[ref-pypi]: https://pypi.org/\n"
}