refrig

package
v0.0.0-...-30c6e40 Latest Latest
Warning

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

Go to latest
Published: Dec 21, 2014 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Pin

type Pin interface {
	High()
	Low()
	// TODO: it'd be better if refrig didn't depend on rpio
	Read() rpio.State
}

type Refrig

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

Refrig is an on/off controller with a recovery period between turning off and turning back on again. It is intended to be a failsafe module, but it's just plain funky. This needs to be in thermo.Stat

func New

func New(name string, control Pin, recovery time.Duration) *Refrig

New makes a Refrig on the given pin. State is Run/Stop depending on state of pin.

func (*Refrig) IsStarted

func (r *Refrig) IsStarted() bool

func (*Refrig) IsStopped

func (r *Refrig) IsStopped() bool

func (*Refrig) SetRecovery

func (r *Refrig) SetRecovery()

SetRecovery sets the pin low and starts the Recover state.

func (*Refrig) Start

func (r *Refrig) Start() error

func (*Refrig) Stop

func (r *Refrig) Stop() error

func (*Refrig) String

func (r *Refrig) String() string

type RunState

type RunState int
const (
	Unknown RunState = iota
	Stop
	Run
	Recover
)

Jump to

Keyboard shortcuts

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