tmp006

package
v0.0.0-...-9401acd Latest Latest
Warning

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

Go to latest
Published: Sep 9, 2014 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package tmp006 allows interfacing with the TMP006 thermopile.

Index

Constants

This section is empty.

Variables

View Source
var (
	SR1  = &SampleRate{0x0000, 1, 0.25} // 1 sample, 0.25 second between measurements.
	SR2  = &SampleRate{0x0200, 2, 0.5}  // 2 samples, 0.5 second between measurements.
	SR4  = &SampleRate{0x0400, 4, 1}    // 4 samples, 1 second between measurements.
	SR8  = &SampleRate{0x0600, 8, 2}    // 8 samples, 2 seconds between measurements.
	SR16 = &SampleRate{0x0800, 16, 4}   // 16 samples, 4 seconds between measurements.
)

Functions

This section is empty.

Types

type SampleRate

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

type TMP006

type TMP006 struct {
	// Bus to communicate over.
	Bus embd.I2CBus
	// Addr of the sensor.
	Addr byte
	// SampleRate specifies the sampling rate for the sensor.
	SampleRate *SampleRate
	// contains filtered or unexported fields
}

TMP006 represents a TMP006 thermopile sensor.

func New

func New(bus embd.I2CBus, addr byte) *TMP006

New creates a new TMP006 sensor.

func (*TMP006) Close

func (d *TMP006) Close() error

Close puts the device into low power mode.

func (*TMP006) ObjTemp

func (d *TMP006) ObjTemp() (float64, error)

ObjTemp returns the current obj temp reading.

func (*TMP006) ObjTemps

func (d *TMP006) ObjTemps() <-chan float64

ObjTemps returns a channel to fetch obj temps from.

func (*TMP006) Present

func (d *TMP006) Present() (bool, error)

Present checks if the device is present at the given address.

func (*TMP006) RawDieTemp

func (d *TMP006) RawDieTemp() (float64, error)

RawDieTemp returns the current raw die temp reading.

func (*TMP006) RawDieTemps

func (d *TMP006) RawDieTemps() <-chan float64

RawDieTemps returns a channel to get future raw die temps from.

func (*TMP006) Start

func (d *TMP006) Start() error

Start starts the data acquisition loop.

Jump to

Keyboard shortcuts

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