{ "info": { "author": "Julian Metzler", "author_email": "pylcd@mezgr.de", "bugtrack_url": null, "classifiers": [], "description": "pyLCD \u2013 A library for controlling LCDs on various hardware backends\n===================================================================\nThe instructions and tips below are for HD44780 compatible character LCDs. Using KS0108 compatible graphical LCDs is basically the same, only with different pin names and function names.\n\nLicense\n-------\nThis program is licensed under the AGPLv3. See the `LICENSE` file for more information.\n\nInstallation\n------------\nYou can easily install the pyLCD lib using the Python Package Index. Just type:\n\n\tsudo pip install pylcd\n\nHardware support\n----------------\nThis library supports multiple hardware platforms for input and output.\n\nCurrently available output backends:\n* Velleman K8055 USB Experiment Interface Board\n* Raspberry Pi GPIO pins\n* Arduino pins using serial communication (Still in development)\n* Debug output showing the states of the interface pins\n* Dummy output that does nothing\n\nCurrently available input backends:\n* System standard input (e.g. Keyboard)\n* Raspberry Pi GPIO pins\n* No input\n\nSee the usage examples below for examples on how to use them.\n\nOutput pinmaps\n--------------\nWhen instantiating a display, you need to pass it a dictionary containing a mapping from pin names on the LCD to output numbers on the device you're connecting the LCD to.\nFor a K8055, you might want to use this pinmap:\n\n```python\nPINMAP = {\n\t'RS': 1,\n\t'RW': 2,\n\t'E': 3,\n\t'D4': 4,\n\t'D5': 5,\n\t'D6': 6,\n\t'D7': 7,\n\t'LED': 9,\n}\n```\n\nNote that the backlight LED pin is numbered 9 here, even though the K8055 only has 8 digital outputs. But since there are two additional analog outputs, I numbered them 9 and 10 to avoid confusion.\nUsing an analog output for backlight control enables you to dim the backlight by using PWM!\n\nFor a Raspberry Pi, you need to use WiringPi's `WPI_MODE_GPIO` pin numbering scheme. I connected my LCD as follows:\n\n```python\nPINMAP = {\n\t'RS': 2,\n\t'RW': 3,\n\t'E': 4,\n\t'D4': 22,\n\t'D5': 10,\n\t'D6': 9,\n\t'D7': 11,\n\t'LED': 18,\n}\n```\n\nBy using pin 18 for the backlight control, it's once again possible to dim the backlight since this pin is the only available hardware PWM pin of the Pi, so I recommend using this one.\nIf you are using the `DebugBackend` backend, the pin numbers don't matter.\n\nInput pinmaps\n-------------\nIf you are using an input module that uses I/O pins, you need to specify a pinmap for that module as well.\nCurrently, only five keys are supported: Up, Left, OK, Right and Down, as well as two LEDs: Ready and Error.\nMy pinmap looks like this:\n\n```python\nINPUT_PINMAP = {\n\t'UP': 23,\n\t'LEFT': 7,\n\t'OK': 8,\n\t'RIGHT': 24,\n\t'DOWN': 25,\n\t'READY': 27,\n\t'ERROR': 22,\n}\n```\n\nCharacter maps\n--------------\nYou can also specify a character map to use for defining custom characters. This is a dictionary in the following format:\n\n```python\nCHARMAP = {\n\t0: (\n\t\t0b10101,\n\t\t0b01010,\n\t\t0b10101,\n\t\t0b01010,\n\t\t0b10101,\n\t\t0b01010,\n\t\t0b10101,\n\t\t0b01010,\n\t),\n}\n```\n\nThe keys should be integers from 0 to 7, since the HD44780 can store up to 8 custom characters.\nThe values should be tuples or lists of 8 integers, where each integer represents a line of the custom character. I recommend writing these integers in binary notation, since it's easy to see which pixels will be active and which won't if you do it this way.\n\nYou can also specify a single key, `dir`, to load custom characters from image files:\n\n```python\nCHARMAP = {\n\t'dir': \"/path/to/directory\",\n}\n```\n\nThe specified directory should contain up to 8 image files (preferably in PNG format) numbered `0.` to `7.`. Each of these files must be 5 pixels wide and 8 pixels tall and should consist of black and white pixels, where a black pixel will translate into an active pixel on the display.\nTo use this feature, you need to have the Python Imaging Library (PIL) installed.\n\nUser Interface\n--------------\nThis library comes with a `DisplayUI` class which allows you to create simple text-based user interfaces with just a few lines of code!\nSee the usage examples below. Have a look at the `lcd.py` file to see what is possible.\n\nUsage examples\n--------------\nTo initialize a standard 16x2 character LCD with a blinking cursor on a Raspberry Pi, you would do:\n\n```python\nimport hd44780\nPINMAP = {} # Your pinmap here\ndisplay = hd44780.Display(backend = hd44780.GPIOBackend, pinmap = PINMAP, lines = 2, columns = 16)\ndisplay.set_display_enable(cursor = True, cursor_blink = True)\ndisplay.clear()\ndisplay.home()\n```\n\nTo display a Yes / No dialog and react to the user's choice on said display, using physical keys attached to the Pi, do the following:\n\n```python\nINPUT_PINMAP = {} # Your pinmap here\nui = hd44780.DisplayUI(display, hd44780.GPIOInput, input_kwargs = {'pinmap': INPUT_PINMAP})\nselected_index, selected_text = ui.dialog(\"Proceed?\", buttons = (\"Yes\", \"No\"))\nif selected_index == 0:\n\tui.message(\"Doing stuff...\")\nelse:\n\tui.message(\"Aborted.\")\n```\n\nNote that if you are using the `SystemInput` input backend you need to be able to send keypresses to the terminal running the script, or else it won't be able to react to your input.\nFor more examples I would suggest looking at the included example scripts.\n", "description_content_type": null, "docs_url": null, "download_url": null, "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/Mezgrman/pyLCD", "keywords": "library lcd display hd44780 ks0108 interface", "license": "AGPLv3", "maintainer": null, "maintainer_email": null, "name": "pyLCD", "package_url": "https://pypi.org/project/pyLCD/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/pyLCD/", "project_urls": { "Homepage": "https://github.com/Mezgrman/pyLCD" }, "release_url": "https://pypi.org/project/pyLCD/1.1.3/", "requires_dist": null, "requires_python": null, "summary": "A library for controlling LCDs on various hardware backends", "version": "1.1.3" }, "last_serial": 1669453, "releases": { "1.0.0": [ { "comment_text": "", "digests": { "md5": "536abd8fa801b114235c94864a2e4ebb", "sha256": "8aef8697cbe6dfe347720fc74a1993edec7211ce128be5822979cb0b56cab66d" }, "downloads": -1, "filename": "pyLCD-1.0.0.tar.gz", "has_sig": false, "md5_digest": "536abd8fa801b114235c94864a2e4ebb", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 28628, "upload_time": "2013-05-13T11:58:06", "url": "https://files.pythonhosted.org/packages/9c/15/b4545dc115fa83b764ee581c917c357bc56f607c7d61fc4a331d08ac570f/pyLCD-1.0.0.tar.gz" } ], "1.1.0": [ { "comment_text": "", "digests": { "md5": "d293b82895554e44d9029ae71afffc0b", "sha256": "d0330cacb09ec64a9c212452da2ad27063d85d2357b61cf7d75a66938f810cfe" }, "downloads": -1, "filename": "pyLCD-1.1.0.tar.gz", "has_sig": false, "md5_digest": "d293b82895554e44d9029ae71afffc0b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 35361, "upload_time": "2013-05-16T19:18:31", "url": "https://files.pythonhosted.org/packages/ad/7d/2e8d8380b515f9fed78b7f073f1e930546d11ca0a61891722006107882df/pyLCD-1.1.0.tar.gz" } ], "1.1.1": [ { "comment_text": "", "digests": { "md5": "fa86c9d5ba342eafc13db26a0e79f467", "sha256": "fc89bf3a96b1e79fd3d4261a681b6fb3da440a2170be803ffeb26c6cd0ad2f44" }, "downloads": -1, "filename": "pyLCD-1.1.1.tar.gz", "has_sig": false, "md5_digest": "fa86c9d5ba342eafc13db26a0e79f467", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 36884, "upload_time": "2013-05-27T21:39:33", "url": "https://files.pythonhosted.org/packages/3b/38/5d1f20fe3287ba31475c15770ab88e2133228fc051920f7e6041c3419d82/pyLCD-1.1.1.tar.gz" } ], "1.1.2": [ { "comment_text": "", "digests": { "md5": "4f037beedc49f467b695fc230b57c141", "sha256": "17d8c71c1506538a59b59b584f6f49439bdfab46053229de164a4c09e1ee5ec0" }, "downloads": -1, "filename": "pyLCD-1.1.2.tar.gz", "has_sig": false, "md5_digest": "4f037beedc49f467b695fc230b57c141", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 71327, "upload_time": "2014-10-11T22:50:34", "url": "https://files.pythonhosted.org/packages/dd/c7/02bd1ba1fdc3dada34524453cd562db961b3ab72bb12169869b36b56833e/pyLCD-1.1.2.tar.gz" } ], "1.1.3": [ { "comment_text": "", "digests": { "md5": "2ef1878edc2511158334d65eb7097b5c", "sha256": "0a907b36255a823673729ff3cfdc45d5bd5a36f6bda516f6a445700f6dcc73c1" }, "downloads": -1, "filename": "pyLCD-1.1.3.tar.gz", "has_sig": false, "md5_digest": "2ef1878edc2511158334d65eb7097b5c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 72052, "upload_time": "2015-08-08T11:10:27", "url": "https://files.pythonhosted.org/packages/cc/a4/44338c57079cda551fefecdd1d8a6fb5bd829949563fb106acb7e175389d/pyLCD-1.1.3.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "2ef1878edc2511158334d65eb7097b5c", "sha256": "0a907b36255a823673729ff3cfdc45d5bd5a36f6bda516f6a445700f6dcc73c1" }, "downloads": -1, "filename": "pyLCD-1.1.3.tar.gz", "has_sig": false, "md5_digest": "2ef1878edc2511158334d65eb7097b5c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 72052, "upload_time": "2015-08-08T11:10:27", "url": "https://files.pythonhosted.org/packages/cc/a4/44338c57079cda551fefecdd1d8a6fb5bd829949563fb106acb7e175389d/pyLCD-1.1.3.tar.gz" } ] }