LCD1602 Pin | 树莓派 Pin |
---|---|
VSS | Ground |
VDD | 5v Power |
V0 | 液晶对比度调节,接电位器(需要一个10k电位器)中间的引脚,电位器两边的引脚分别接5v和接地。 |
RS | BCM14 |
RW | Ground |
EN | BCM 15 |
D0 | 悬空 |
D1 | 悬空 |
D2 | 悬空 |
D3 | 悬空 |
D4 | BCM 17 |
D5 | BCM 18 |
D6 | BCM 27 |
D7 | BCM 22 |
A | 5v Power |
K | Ground |
package main
import (
"github.com/qinxin0720/lcd1602"
)
func main() {
lcd := lcd1602.NewAdafruitCharlcd(14, 15, [4]int{17, 18, 27, 22})
defer lcd.Close()
lcd.Init()
lcd.Clear()
lcd.Message(" LCD 1602 Test \n123456789ABCDEF")
}
这个项目使用MIT许可