Go library for communicating to lcd1602 from Raspberry Pi
MIT License
Use LCD screens in your Go RPi applications!
The timing in this library is optimized to run as smoot as possible. (It takes ~40 microseconds to write one character to the LCD, opposed to many online examples taking 5-10 milliseconds).
You can use Animations (see animations, and examples/animations.go) to slide text into and out of the LCD.
You can also create your own animations by implementing the Animation
interface.
I wrote a virtual representation of an LCD screen. You can use it for debugging on de command line, or when your LCD is broken...
import "github.com/pimvanhespen/go-pi-lcd1602"
Also checkout the examples!
// write code to your LCD in 5 simple steps!
// 1. Define the LCD config (which pins are used)
lcdi := lcd1602.New(
10, //rs
9, //enable
[]int{6, 13, 19, 26}, //datapins
16, //lineSize
)
// 2. Create a synchronized LCD (for writing both lines easily)
lcd := synchronized.NewSynchronizedLCD(lcdi)
// 3. Init the LCD
lcd.Initialize()
// 4. Write text to the LCD
lcd.WriteLines("Go Rpi LCD 1602", "git/PimvanHespen")
// 5. Close the lcd (i.e. clean up GPIO memory)
lcd.Close()
}
This library is built using Stian Eikelands go-rpio library.