Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mikestreety/pypi-lcdscreen
A class to write to a LCD Screen using a raspberry pi
https://github.com/mikestreety/pypi-lcdscreen
Last synced: 3 months ago
JSON representation
A class to write to a LCD Screen using a raspberry pi
- Host: GitHub
- URL: https://github.com/mikestreety/pypi-lcdscreen
- Owner: mikestreety
- Created: 2015-03-30T20:48:29.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2015-04-11T18:11:09.000Z (almost 10 years ago)
- Last Synced: 2024-10-13T01:36:43.470Z (4 months ago)
- Language: Python
- Size: 145 KB
- Stars: 5
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: readme.rst
Awesome Lists containing this project
README
LCD Screen Python Class
=======================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_.
.. _example.py: https://github.com/mikestreety/pypi-lcdscreen/blob/master/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