Support for HD44780 in 4 and 8 bit mode

This commit is contained in:
k-brk
2019-05-01 00:12:31 +02:00
committed by Ron Evans
parent 8ac1fa2b22
commit 715829cdbd
4 changed files with 427 additions and 0 deletions
+20
View File
@@ -0,0 +1,20 @@
package main
import (
"machine"
"github.com/tinygo-org/drivers/hd44780"
)
func main() {
lcd, _ := hd44780.NewGPIO4Bit([]uint8{machine.P0, machine.P1, machine.P2, machine.P3}, machine.P4, machine.P5, machine.P6)
lcd.Configure(hd44780.Config{Width: 16, Height: 2, CursorOnOff: true, CursorBlink: true})
lcd.CreateCharacter(0x0, []byte{0x04, 0x0E, 0x0E, 0x0E, 0x0E, 0x1F, 0x04, 0x0})
lcd.Write([]byte{0x0})
lcd.Display()
for {
}
}
+20
View File
@@ -0,0 +1,20 @@
package main
import (
"machine"
"github.com/tinygo-org/drivers/hd44780"
)
func main() {
lcd, _ := hd44780.NewGPIO4Bit([]uint8{machine.P0, machine.P1, machine.P2, machine.P3}, machine.P4, machine.P5, machine.P6)
lcd.Configure(hd44780.Config{Width: 16, Height: 2, CursorOnOff: true, CursorBlink: true})
lcd.Write([]byte("This is a long line"))
lcd.Display()
for {
}
}