onewire

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Jul 4, 2023 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetIDs

func GetIDs(devicePath string, prefix Prefix) ([]string, error)

Types

type Ds18b20

type Ds18b20 struct {
	ID string
	// contains filtered or unexported fields
}

Ds18b20 is a GPIO 1-wire temperature probe.

func NewDs18b20

func NewDs18b20(id string, options ...OptionsFunc) (*Ds18b20, error)

NewDs18b20 Create a new ds18b20 Thermometer.

func (*Ds18b20) GetID

func (d *Ds18b20) GetID() string

func (*Ds18b20) GetTemperature

func (d *Ds18b20) GetTemperature() (float64, error)

ReadTemperature read the current temperature of the Thermometer.

type OptionsFunc

type OptionsFunc func(*Ds18b20)

func SetDevicePath

func SetDevicePath(path string) OptionsFunc

type Prefix

type Prefix string
const (
	Ds18b20Prefix Prefix = "28-"

	DefaultDevicePath = "/sys/bus/w1/devices/"
)

Jump to

Keyboard shortcuts

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