button

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Oct 19, 2025 License: BSD-2-Clause Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(name string, offset int, opts ...gpiocdev.LineReqOption) devices.Device[int]

New creates a new button with the given name, offset represents the pin number and a series of line options. Todo reference the gpiodev manual for LineReq options

Types

type Button

type Button struct {
	*drivers.DigitalPin
}

Button is a simple momentary GPIO Device that can be detected with the Button is pushed (rising edge) or when it is released (falling edge). Low is open, high is closed.

func (*Button) Close

func (b *Button) Close() error

func (*Button) Get

func (b *Button) Get() (int, error)

ReadPub will read the value of the button and publish the results.

func (*Button) ID

func (b *Button) ID() string

func (*Button) Open

func (b *Button) Open() error

func (*Button) Set

func (b *Button) Set(but int) error

func (*Button) Type

func (b *Button) Type() devices.Type

Jump to

Keyboard shortcuts

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