tinygo.org/x/drivers@v0.27.1-0.20240509133757-7dbca2a54349/examples/hd44780/text/main.go (about)

     1  package main
     2  
     3  import (
     4  	"machine"
     5  
     6  	"tinygo.org/x/drivers/hd44780"
     7  )
     8  
     9  func main() {
    10  
    11  	lcd, _ := hd44780.NewGPIO4Bit(
    12  		[]machine.Pin{machine.P0, machine.P1, machine.P2, machine.P3},
    13  		machine.P4,
    14  		machine.P5,
    15  		machine.P6,
    16  	)
    17  
    18  	lcd.Configure(hd44780.Config{
    19  		Width:       16,
    20  		Height:      2,
    21  		CursorOnOff: true,
    22  		CursorBlink: true,
    23  	})
    24  
    25  	lcd.Write([]byte("This is a long line"))
    26  	lcd.Display()
    27  
    28  	for {
    29  
    30  	}
    31  }