monochromeoled

package
v0.0.0-...-c23b462 Latest Latest
Warning

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

Go to latest
Published: Sep 7, 2019 License: Apache-2.0 Imports: 4 Imported by: 0

README

WIP, the package is coming soon...

Documentation

Overview

Package monochromeoled contains an Adafruit Monochrome OLED (SSD1306) display driver.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type OLED

type OLED struct {
	// contains filtered or unexported fields
}

OLED represents an SSD1306 OLED display.

func Open

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

Open opens an SSD1306 OLED display. Once not in use, it needs to be close by calling Close. The default width is 128, height is 64 if zero values are given.

func OpenWithI2c

func OpenWithI2c(i2cDevice *i2c.Device, height int) (*OLED, error)

OpenWithI2c create an OLED object using a giving i2cDevice . Once not in use, it needs to be close by calling Close. The default width is 128, height is 64 if zero values are given.

func (*OLED) Clear

func (o *OLED) Clear() error

Clear clears the entire display.

func (*OLED) Close

func (o *OLED) Close() error

Close closes the display.

func (*OLED) DisableScroll

func (o *OLED) DisableScroll() error

DisableScroll stops the scrolling on the display.

func (*OLED) Draw

func (o *OLED) Draw() error

Draw draws the intermediate pixel buffer on the display. See SetPixel and SetImage to mutate the buffer.

func (*OLED) EnableScroll

func (o *OLED) EnableScroll(startY, endY int) error

EnableScroll starts scrolling in the horizontal direction starting from startY column to endY column.

func (*OLED) Height

func (o *OLED) Height() int

Height returns the display height.

func (*OLED) Off

func (o *OLED) Off() error

Off turns off the display if it is on.

func (*OLED) On

func (o *OLED) On() error

On turns on the display if it is off.

func (*OLED) SetImage

func (o *OLED) SetImage(x, y int, img image.Image) 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.

func (*OLED) SetPixel

func (o *OLED) SetPixel(x, y int, v byte) error

func (*OLED) Width

func (o *OLED) Width() int

Width returns the display width.

Directories

Path Synopsis
examples

Jump to

Keyboard shortcuts

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