RPLCD | A Raspberry Pi LCD library for the widely used Hitachi HD44780 controller, written in Python. GPIO (
kandi X-RAY | RPLCD Summary
kandi X-RAY | RPLCD Summary
A Raspberry Pi LCD library for the widely used Hitachi HD44780 controller, written in Python. GPIO (parallel) and I²C modes supported.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Send an instruction
- Send data to GPIO
- Pulse data
- Pulse the pins
- Write 4 bits
- Write 8 bits to the pin
- Wait for the device to finish
- Set backlight mode
- Write byte to file
- Context manager
- Clears the screen
- Set the text alignment mode
- Close the connection
- Send data to the device
- Set the write shift mode
- Set the cursor position
- Set the cursor mode
- Enable or disable display
RPLCD Key Features
RPLCD Examples and Code Snippets
Community Discussions
Trending Discussions on RPLCD
QUESTION
I am new to electronics and has completed a tutorial on how to operate a 16x2 Character LCD via I2C in Arduino using liquidCrystal_I2C. Everything works fine but I have a question about the low level interaction between the I2C and the LCD. Looking at the library's source code, I notice that when writing a 4 bits nibble (LiquidCrystal_I2C::write4bits
), the code writes the nibble to the I2C expander first
(LiquidCrystal_I2C::expanderWrite
), and then writes again when pulsing the Enable bit. Why is the first expanderWrite
necessary? Why can't write4bits just call pulseEnable
(with the blacklight bit set)?
I am sure there is a reason as I checked other library like RPLCD and see a similar pattern. Can anyone enlighten me? Thank you.
...ANSWER
Answered 2017-Jul-01 at 01:13From the datasheet I found the LCD requires specific timing in the communication protocol.
On the rising edge of the enable line the Register Select and Read/Write lines must have already settled for tsu1 (100ns). On the falling edge of the enable line the data must have already settled for tsu2 (60ns). By writing _data
they are also writing the RS and R/W lines as they are the lower nibble of _data
.
This article covers the topic very thoroughly.
QUESTION
I tried a try: catch but it isn't working. I suppose I could change it to an if statement but don't understand why this isn't working. This is my very first "real" project. I'm building an irrigation controller and creating a dictionary of schedules for irrigation. The first is the code I have so far and the second code is the "test" by itself that I'm trying. Every time I run the code it rewrites over the existing file, when what I want is for it to open the file if it already exists and NOT write it again.
...ANSWER
Answered 2017-Jun-19 at 21:01You can use os.path.exists("schedule.dat")
. It returns a boolean result.
An alternative solution using os.stat
involves:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install RPLCD
You can use RPLCD like any standard Python library. You will need to make sure that you have a development environment consisting of a Python distribution including header files, a compiler, pip, and git installed. Make sure that your pip, setuptools, and wheel are up to date. When using pip it is generally recommended to install packages in a virtual environment to avoid changes to the system.
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page