Skip to main content

A class to write to a LCD Screen using a raspberry pi

Project description

This class makes it easy to write messages to your LCD screen via your Raspberry Pi.

For a working example of the class, see example.py.

Installation

Install from pip

pip install lcdscreen

From there you can use it as you wish!

from lcdscreen import LCDScreen

Next, initialise the class, passing in the parameters as required:

lcd = LCDScreen({
        'pin_rs': 25,
        'pin_e': 24,
        'pins_db': [23, 17, 27, 22],
        'backlight': 18,
        'dimensions': [20, 4]
})

The defaults are below. If you don’t wish to change anything then you can initilise without passing anything in:

config_preset = {
        'pin_rs': 25, # The input of the RS pin
        'pin_e': 24, # The input of the E pin
        'pins_db': [23, 17, 27, 22], # The input of the DB pins
        'backlight': 18, # The input of the Backlight pin
        'dimensions': [20, 4], # How big your screen is [width, height]
        'delay': 3, # The default delay time
        'spacer': ' ' # The default spacer character
        'truncate': '..' # What to add to a truncated string if the message is longer than the screen width
}

Once initialised, it’s quite easy to operate. The class is well documented and the exmaple file shows how to use it

Usage

Backlight

Turn the backlight on:

lcd.backlight('on')

And turn it off:

lcd.backlight('off')

Message

lcd.message('Your message')

Delay

lcd.delay() # Delay by default delay time (set in config)
lcd.delay(5) # Delay by 5 seconds
lcd.delay_clear() # Wait default delay time then clear the screen

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

lcdscreen-1.2.1.tar.gz (4.3 kB view details)

Uploaded Source

Built Distribution

lcdscreen-1.2.1-py2.py3-none-any.whl (6.1 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file lcdscreen-1.2.1.tar.gz.

File metadata

  • Download URL: lcdscreen-1.2.1.tar.gz
  • Upload date:
  • Size: 4.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for lcdscreen-1.2.1.tar.gz
Algorithm Hash digest
SHA256 5a912487be2e36bc352c5e2462b149a6a7c89bc271f398632143555a9dc85d04
MD5 88e1baa9ce5befe2f41464fb8bf18a24
BLAKE2b-256 f393aa22c4040cc034b9bf35333bb83807d89820515d0f44321d3236e565d2b9

See more details on using hashes here.

File details

Details for the file lcdscreen-1.2.1-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for lcdscreen-1.2.1-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 fdf9d1a546ce60fa400e706858f2a246f0c68c084a4da3205729875a0aed58b5
MD5 b2ad96e5f2ec8c94c815be877978a82e
BLAKE2b-256 78c55f6c9949531471282b48ec5fdbee0aa3bf9c42931d37ec1426846edb0de1

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page