micropython-i2c-lcd


Namemicropython-i2c-lcd JSON
Version 0.1.1 PyPI version JSON
download
home_pagehttps://github.com/brainelectronics/micropython-i2c-lcd
SummaryMicroPython package to control HD44780 LCD displays 1602 and 2004
upload_time2023-06-12 19:08:38
maintainer
docs_urlNone
authorbrainelectronics
requires_python
licenseMIT
keywords micropython hd44780 i2c display lcd1602 lcd2004 pcf8574
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage
            # MicroPython I2C LCD

[![Downloads](https://pepy.tech/badge/micropython-i2c-lcd)](https://pepy.tech/project/micropython-i2c-lcd)
![Release](https://img.shields.io/github/v/release/brainelectronics/micropython-i2c-lcd?include_prereleases&color=success)
![MicroPython](https://img.shields.io/badge/micropython-Ok-green.svg)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
[![codecov](https://codecov.io/github/brainelectronics/micropython-i2c-lcd/branch/main/graph/badge.svg)](https://app.codecov.io/github/brainelectronics/micropython-i2c-lcd)
[![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)

MicroPython package to control HD44780 LCD displays 1602 and 2004 via I2C

---------------

## General

MicroPython package to control HD44780 LCD displays 1602 and 2004 via I2C

📚 The latest documentation is available at
[MicroPython I2C LCD ReadTheDocs][ref-rtd-micropython-i2c-lcd] 📚

<!-- MarkdownTOC -->

- [Installation](#installation)
	- [Install required tools](#install-required-tools)
- [Setup](#setup)
	- [Install package with upip](#install-package-with-upip)
		- [General](#general)
		- [Specific version](#specific-version)
		- [Test version](#test-version)
	- [Manually](#manually)
		- [Upload files to board](#upload-files-to-board)
- [Usage](#usage)
- [Credits](#credits)

<!-- /MarkdownTOC -->

## Installation

### Install required tools

Python3 must be installed on your system. Check the current Python version
with the following command

```bash
python --version
python3 --version
```

Depending on which command `Python 3.x.y` (with x.y as some numbers) is
returned, use that command to proceed.

```bash
python3 -m venv .venv
source .venv/bin/activate

pip install -r requirements.txt
```

## Setup

### Install package with upip

Connect the MicroPython device to a network (if possible)

```python
import network
station = network.WLAN(network.STA_IF)
station.active(True)
station.connect('SSID', 'PASSWORD')
station.isconnected()
```

#### General

Install the latest package version of this lib on the MicroPython device

```python
import mip
mip.install("github:brainelectronics/micropython-i2c-lcd")
```

For MicroPython versions below 1.19.1 use the `upip` package instead of `mip`

```python
import upip
upip.install('micropython-i2c-lcd')
```

#### Specific version

Install a specific, fixed package version of this lib on the MicroPython device

```python
import mip
# install a verions of a specific branch
mip.install("github:brainelectronics/micropython-i2c-lcd", version="feature/initial-implementation")
# install a tag version
mip.install("github:brainelectronics/micropython-i2c-lcd", version="0.1.0")
```

For MicroPython versions below 1.19.1 use the `upip` package instead of `mip`

```python
import upip
upip.install('micropython-i2c-lcd==0.1.0')
```

#### Test version

Install a specific release candidate version uploaded to
[Test Python Package Index](https://test.pypi.org/) on every PR on the
MicroPython device. If no specific version is set, the latest stable version
will be used.

```python
import mip
mip.install("github:brainelectronics/micropython-i2c-lcd", version="0.1.0-rc3.dev1")
```

For MicroPython versions below 1.19.1 use the `upip` package instead of `mip`

```python
import upip
# overwrite index_urls to only take artifacts from test.pypi.org
upip.index_urls = ['https://test.pypi.org/pypi']
upip.install('micropython-i2c-lcd==0.1.0rc3.dev1')
```

### Manually

#### Upload files to board

Copy the module to the MicroPython board and import them as shown below
using [Remote MicroPython shell][ref-remote-upy-shell]

Open the remote shell with the following command. Additionally use `-b 115200`
in case no CP210x is used but a CH34x.

```bash
rshell --port /dev/tty.SLAB_USBtoUART --editor nano
```

Perform the following command inside the `rshell` to copy all files and
folders to the device

```bash
mkdir /pyboard/lib
mkdir /pyboard/lib/lcd_i2c

cp lcd_i2c/* /pyboard/lib/lcd_i2c

cp examples/main.py /pyboard
cp examples/boot.py /pyboard
```

## Usage

```python
from lcd_i2c import LCD
from machine import I2C, Pin

# PCF8574 on 0x50
I2C_ADDR = 0x27     # DEC 39, HEX 0x27
NUM_ROWS = 2
NUM_COLS = 16

# define custom I2C interface, default is 'I2C(0)'
# check the docs of your device for further details and pin infos
i2c = I2C(0, scl=Pin(13), sda=Pin(12), freq=800000)
lcd = LCD(addr=I2C_ADDR, cols=NUM_COLS, rows=NUM_ROWS, i2c=i2c)

lcd.begin()
lcd.print("Hello World")
```

For further examples check the `examples` folder or the Example chapter in the
docs.

## Credits

Based on [Frank de Brabanders Arduino LiquidCrystal I2C Library][ref-arduino-lcd-i2c-library].

<!-- Links -->
[ref-rtd-micropython-i2c-lcd]: https://micropython-i2c-lcd.readthedocs.io/en/latest/
[ref-remote-upy-shell]: https://github.com/dhylands/rshell
[ref-arduino-lcd-i2c-library]: https://github.com/fdebrabander/Arduino-LiquidCrystal-I2C-library
[ref-test-pypi]: https://test.pypi.org/
[ref-pypi]: https://pypi.org/



            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/brainelectronics/micropython-i2c-lcd",
    "name": "micropython-i2c-lcd",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "micropython,HD44780,I2C,display,LCD1602,LCD2004,PCF8574",
    "author": "brainelectronics",
    "author_email": "info@brainelectronics.de",
    "download_url": "https://files.pythonhosted.org/packages/f1/22/fc67520efa386b42f71d622d8ff0195b9264f440d8aa26b6709700bae198/micropython-i2c-lcd-0.1.1.tar.gz",
    "platform": null,
    "description": "# 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\ud83d\udcda The latest documentation is available at\n[MicroPython I2C LCD ReadTheDocs][ref-rtd-micropython-i2c-lcd] \ud83d\udcda\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\n\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "MicroPython package to control HD44780 LCD displays 1602 and 2004",
    "version": "0.1.1",
    "project_urls": {
        "Bug Reports": "https://github.com/brainelectronics/micropython-i2c-lcd/issues",
        "Homepage": "https://github.com/brainelectronics/micropython-i2c-lcd",
        "Source": "https://github.com/brainelectronics/micropython-i2c-lcd"
    },
    "split_keywords": [
        "micropython",
        "hd44780",
        "i2c",
        "display",
        "lcd1602",
        "lcd2004",
        "pcf8574"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "f122fc67520efa386b42f71d622d8ff0195b9264f440d8aa26b6709700bae198",
                "md5": "92337da06ff031e2735219336fb5e15d",
                "sha256": "e611d3f59ecbd3143cd132725508051619c8cc04632b87e4b7cd800fe512a6ab"
            },
            "downloads": -1,
            "filename": "micropython-i2c-lcd-0.1.1.tar.gz",
            "has_sig": false,
            "md5_digest": "92337da06ff031e2735219336fb5e15d",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 7945,
            "upload_time": "2023-06-12T19:08:38",
            "upload_time_iso_8601": "2023-06-12T19:08:38.546376Z",
            "url": "https://files.pythonhosted.org/packages/f1/22/fc67520efa386b42f71d622d8ff0195b9264f440d8aa26b6709700bae198/micropython-i2c-lcd-0.1.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-06-12 19:08:38",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "brainelectronics",
    "github_project": "micropython-i2c-lcd",
    "travis_ci": false,
    "coveralls": true,
    "github_actions": true,
    "requirements": [],
    "lcname": "micropython-i2c-lcd"
}
        
Elapsed time: 1.75556s