bonnet

package
v0.0.0-...-f66468e Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2017 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	A     = "A"
	B     = "B"
	C     = "C"
	Up    = "UP"
	Down  = "DOWN"
	Left  = "LEFT"
	Right = "RIGHT"
)

Those are the available buttons on the bonnet

Variables

This section is empty.

Functions

This section is empty.

Types

type Bonnet

type Bonnet struct {
	*ssd1306.I2C

	Events chan Event
	// contains filtered or unexported fields
}

Bonnet drives the Adafruit 128x64 OLED Bonnet for Raspberry Pi see https://www.adafruit.com/product/3531

func New

func New(name string, rotated bool) (*Bonnet, error)

New creates a driver for the Adafruit 128x64 OLED Bonnet for Raspberry Pi. Name can be an I²C bus name, an alias or a number. Specify an empty name "" to get the first available bus.

func (*Bonnet) Close

func (b *Bonnet) Close(turnoff bool)

Close closes the display

type Event

type Event struct {
	When    time.Time
	Button  string
	Pressed bool
}

Event represent a button change event

Jump to

Keyboard shortcuts

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