https://github.com/liamg/lcd
Go module for driving (non-I2C) LCD devices
https://github.com/liamg/lcd
driver go golang hd44780 lcd lcd1602 lcd1604 lcd16x2 lcd16x4 lcd2004 lcd20x4 raspberry-pi
Last synced: 21 days ago
JSON representation
Go module for driving (non-I2C) LCD devices
- Host: GitHub
- URL: https://github.com/liamg/lcd
- Owner: liamg
- Created: 2021-09-08T19:26:18.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2023-08-30T13:54:23.000Z (over 2 years ago)
- Last Synced: 2025-03-13T03:32:24.418Z (11 months ago)
- Topics: driver, go, golang, hd44780, lcd, lcd1602, lcd1604, lcd16x2, lcd16x4, lcd2004, lcd20x4, raspberry-pi
- Language: Go
- Homepage:
- Size: 768 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# lcd
A Go module for driving common LCD devices (those using the HD44780 controller or similar.)
Built for Raspberry Pi, but it should work with any other device where you can use an implementation of the [`lcd.Pin`](https://github.com/liamg/lcd/blob/main/pin.go#L3-L9) interface.
- Supports both 4 and 8-bit modes
- Allows definition and use of custom characters
- Tested against virtual LCD (also included in this package)
- Uses BF checking instead of fixed delays for greater efficiency unlike most LCD libraries (pass `nil` as the RW pin if you don't want to use this, and wire the RW pin to GND)
## Example
```golang
package main
import (
"github.com/liamg/lcd"
)
func main() {
lcd, _ := lcd.New1602(
lcd.FontSize5x8,
lcd.PiPin(24), // RS
lcd.PiPin(25), // E
lcd.PiPin(12), // RW
lcd.PiPin(5), // DB4
lcd.PiPin(6), // DB5
lcd.PiPin(13), // DB6
lcd.PiPin(19), // DB7
)
defer lcd.Close()
lcd.WriteLine(0, "Hello World!")
lcd.WriteLine(1, ":)")
}
```
