legohat

package
v0.0.0-...-a3cb26e Latest Latest
Warning

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

Go to latest
Published: Jan 1, 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 HatState

type HatState string

type LegoHatDriver

type LegoHatDriver struct {
	Active       bool
	DefaultState int

	gobot.Eventer
	// contains filtered or unexported fields
}

LegoHatDriver Represents a lego hat driver

func NewLegoHatDriver

func NewLegoHatDriver(a gpio.DigitalReader) *LegoHatDriver

NewLegoHatDriver returns a new LegoHatDriver

func (*LegoHatDriver) Connection

func (l *LegoHatDriver) Connection() gobot.Connection

Connection returns the ButtonDrivers Connection

func (*LegoHatDriver) Halt

func (l *LegoHatDriver) Halt() (err error)

Halt stops polling the button for new information

func (*LegoHatDriver) Name

func (l *LegoHatDriver) Name() string

Name returns the ButtonDrivers name

func (*LegoHatDriver) Pin

func (l *LegoHatDriver) Pin() string

Pin returns the ButtonDrivers pin

func (*LegoHatDriver) SetName

func (l *LegoHatDriver) SetName(n string)

SetName sets the ButtonDrivers name

func (*LegoHatDriver) Start

func (l *LegoHatDriver) Start() (err error)

Emits the Events:

Push int - On button push
Release int - On button release
Error error - On button error

Jump to

Keyboard shortcuts

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