oled

package
v0.0.0-...-df6b22a Latest Latest
Warning

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

Go to latest
Published: Feb 23, 2022 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type OLED

type OLED interface {
	On() error
	// Off turns off the display if it is on.
	Off() error
	// Clear clears the entire display.
	Clear() error
	SetPixel(x, y int, v byte) error
	// SetImage draws an image on the display buffer starting from x, y.
	// A call to Draw is required to display it on the OLED display.
	SetImage(x, y int, img image.Image) error
	// Draw draws the intermediate pixel buffer on the display.
	// See SetPixel and SetImage to mutate the buffer.
	Draw() error
	// StartScroll starts scrolling in the horizontal direction starting from
	// startY column to endY column.
	EnableScroll(startY, endY int) error
	// StopStrolls stops the scrolling on the display.
	DisableScroll() error
	// Width returns the display width.
	Width() int
	// Height returns the display height.
	Height() int
	// Close closes the display.
	Close() error

	// ShowText displays text on specific line to OLED. This is an addition to the
	// existing monochromeoled.OLED functionality.
	ShowText(img *image.RGBA, line int, txtLabel string)
	AddGesture(img *image.RGBA, letterImage [28][28]byte)
}

OLED defines the interface for either a oled or mockOLED

func Open

func Open(o driver.Opener, mock bool) (OLED, error)

Jump to

Keyboard shortcuts

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