An open API service indexing awesome lists of open source software.

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

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, ":)")
}
```

![Demo](demo.png)