lcdrgbbacklight

package
v0.0.0-...-09d1226 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 8, 2016 License: Apache-2.0 Imports: 5 Imported by: 3

README

#Grove - LCD RGB Backlight

GoDoc

Manufacturer info

This device is an i2c colorful RGB backlight display module with Grove compatible 4pin I2C interface. This display supports scrolling as well as English and Japanese fonts plus custom characters using CGRAM.

Grove - LCD RGB Backlight

##Datasheets:

Documentation

Overview

Package lcdrgbbacklight implements a driver for the Grove LCD RGB Backlight display.

Index

Constants

This section is empty.

Variables

View Source
var CustomLCDChars = map[string][8]byte{
	"é":       [8]byte{130, 132, 142, 145, 159, 144, 142, 128},
	"è":       [8]byte{136, 132, 142, 145, 159, 144, 142, 128},
	"ê":       [8]byte{132, 138, 142, 145, 159, 144, 142, 128},
	"à":       [8]byte{136, 134, 128, 142, 145, 147, 141, 128},
	"â":       [8]byte{132, 138, 128, 142, 145, 147, 141, 128},
	"á":       [8]byte{2, 4, 14, 1, 15, 17, 15, 0},
	"î":       [8]byte{132, 138, 128, 140, 132, 132, 142, 128},
	"í":       [8]byte{2, 4, 12, 4, 4, 4, 14, 0},
	"û":       [8]byte{132, 138, 128, 145, 145, 147, 141, 128},
	"ù":       [8]byte{136, 134, 128, 145, 145, 147, 141, 128},
	"ñ":       [8]byte{14, 0, 22, 25, 17, 17, 17, 0},
	"ó":       [8]byte{2, 4, 14, 17, 17, 17, 14, 0},
	"heart":   [8]byte{0, 10, 31, 31, 31, 14, 4, 0},
	"smiley":  [8]byte{0, 0, 10, 0, 0, 17, 14, 0},
	"frowney": [8]byte{0, 0, 10, 0, 0, 0, 14, 17},
}

CustomLCDChars is a map of CGRAM characters that can be loaded into a LCD screen to display custom characters. Some LCD screens such as the Grove screen (jhd1313m1) isn't loaded with latin 1 characters. It's up to the developer to load the set up to 8 custom characters and update the input text so the character is swapped by a byte reflecting the position of the custom character to use. See SetCustomChar

View Source
var (
	ErrInvalidPosition = errors.New("Invalid position value")
)

Functions

This section is empty.

Types

type LCDRGBBacklight

type LCDRGBBacklight struct {
	LCD *i2c.Device
	RGB *i2c.Device
}

LCDRGBBacklight is a driver for the Jhd1313m1 LCD display which has two i2c addresses, one belongs to a controller and the other controls solely the backlight.

func Open

func Open(o driver.Opener) (*LCDRGBBacklight, error)

Open connects to the lcd and rgb openers, connects and sets up.

func (*LCDRGBBacklight) Clear

func (d *LCDRGBBacklight) Clear() error

Clear clears the text on the lCD display.

func (*LCDRGBBacklight) Close

func (d *LCDRGBBacklight) Close() error

Close cleans up the connections

func (*LCDRGBBacklight) Home

func (d *LCDRGBBacklight) Home() error

Home sets the cursor to the origin position on the display.

func (*LCDRGBBacklight) Scroll

func (d *LCDRGBBacklight) Scroll(leftToRight bool) error

Scroll scrolls the text on the display

func (*LCDRGBBacklight) SetCustomChar

func (d *LCDRGBBacklight) SetCustomChar(pos int, charMap [8]byte) error

CustomChar sets one of the 8 CGRAM locations with a custom character. The custom character can be used by writing a byte of value 0 to 7. When you are using LCD as 5x8 dots in function set then you can define a total of 8 user defined patterns (1 Byte for each row and 8 rows for each pattern). Use http://www.8051projects.net/lcd-interfacing/lcd-custom-character.php to create your own characters. To use a custom character, write byte value of the custom character position as a string after having setup the custom character.

func (*LCDRGBBacklight) SetPosition

func (d *LCDRGBBacklight) SetPosition(pos int) (err error)

SetPosition sets the cursor and the data display to pos. 0..15 are the positions in the first display line. 16..32 are the positions in the second display line.

func (*LCDRGBBacklight) SetRGB

func (d *LCDRGBBacklight) SetRGB(r, g, b int) error

SetRGB sets the Red Green Blue value of backlit.

func (*LCDRGBBacklight) Write

func (d *LCDRGBBacklight) Write(message string) error

Write displays the passed message on the screen.

Directories

Path Synopsis
examples

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL