Skip to content

polarspetroll/LiquidCrystalRPI

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

LiquidCrystalRPI

A simple LCD controller package for raspberry pi liquid crystal I²C displays.

Example

import (
  "log"
  "time"

  lcd "github.com/polarspetroll/LiquidCrystalRPI"
)


func main() {
  l, err := lcd.NewLCD(0x27, 16, 2) // specify the I²C device address, width and height
  if err != nil {
    log.Fatal(err)
  }

  /* You can also use the default configuration like so :

  l := lcd.DefaultLCD
  */
  l.Print("Hello World!", 1) // print 'Hello World' at line 1
  l.Print("Second Line", 2) // print 'Second Line' at line 2
  time.Sleep(3 * time.Second)
  l.Clear() // clear the display
  time.Sleep(3 * time.Second)
  l.BackLightOff() // turn off backlight
  time.Sleep(2 * time.Second)
  l.BackLightOn() //turn on backlight
}

Features

  • Scrolling text
  • Backlight control
  • Printing on a specific line
  • Custom characters