ledberry

package
v0.16.0 Latest Latest
Warning

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

Go to latest
Published: Jun 15, 2025 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type LED

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

LED controls a LED on a Raspberry Pi.

func New

func New(path string) (*LED, error)

New returns an LED at the provided path (e.g. /sys/class/led/PWR).

func (*LED) Get

func (l *LED) Get() (bool, error)

Get returns the status of the LED, i.e. on (true) or off (false).

func (*LED) GetActiveMode

func (l *LED) GetActiveMode() (string, error)

GetActiveMode returns the LED's active trigger mode.

func (*LED) GetModes

func (l *LED) GetModes() iter.Seq[string]

GetModes returns the LED's supported trigger modes.

func (*LED) Set

func (l *LED) Set(on bool) error

Set switches the LED on or off.

func (*LED) SetActiveMode

func (l *LED) SetActiveMode(mode string) error

SetActiveMode sets the LED's active trigger mode. Returns an error is the mode is not supported.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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