goDS18B20

package module
v0.0.0-...-6ea0c71 Latest Latest
Warning

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

Go to latest
Published: Nov 9, 2017 License: GPL-2.0 Imports: 10 Imported by: 1

README

goDS18B20

Simple go interface to the 1-wire DS18B20 temperature sensor.

The library provides setup, monitoring, and unit conversion.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Setup

func Setup() error

Setup will ensure the w1-gpio and w1-therm modules are loaded and ensure that there is at least one w1_bus_masterX present

func Slaves

func Slaves() ([]string, error)

Slaves will return a listing of available slaves

Types

type Probe

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

func NewProbe

func NewProbe(id string) (*Probe, error)

func (*Probe) Close

func (p *Probe) Close() error

func (*Probe) Temperature

func (p *Probe) Temperature() (Temperature, error)

func (*Probe) Update

func (p *Probe) Update() error

type ProbeGroup

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

func New

func New() (*ProbeGroup, error)

func (*ProbeGroup) AssignAlias

func (pg *ProbeGroup) AssignAlias(alias, id string) error

func (*ProbeGroup) Close

func (pg *ProbeGroup) Close() error

func (*ProbeGroup) Read

func (pg *ProbeGroup) Read() (map[string]Temperature, error)

func (*ProbeGroup) ReadAlias

func (pg *ProbeGroup) ReadAlias() (map[string]Temperature, error)

func (*ProbeGroup) ReadSingle

func (pg *ProbeGroup) ReadSingle(id string) (Temperature, error)

func (*ProbeGroup) ReadSingleAlias

func (pg *ProbeGroup) ReadSingleAlias(alias string) (Temperature, error)

func (*ProbeGroup) Update

func (pg *ProbeGroup) Update() error

type Temperature

type Temperature float32

func (Temperature) Celsius

func (t Temperature) Celsius() float32

func (Temperature) Centigrade

func (t Temperature) Centigrade() float32

func (Temperature) Fahrenheit

func (t Temperature) Fahrenheit() float32

func (Temperature) Kelvin

func (t Temperature) Kelvin() float32

func (Temperature) String

func (t Temperature) String() string

Jump to

Keyboard shortcuts

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