embd: github.com/kidoman/embd/sensor/tmp006 Index | Files

package tmp006

import "github.com/kidoman/embd/sensor/tmp006"

Package tmp006 allows interfacing with the TMP006 thermopile.


Package Files



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.

type SampleRate Uses

type SampleRate struct {
    // contains filtered or unexported fields

type TMP006 Uses

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 Uses

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

New creates a new TMP006 sensor.

func (*TMP006) Close Uses

func (d *TMP006) Close() error

Close puts the device into low power mode.

func (*TMP006) ObjTemp Uses

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

ObjTemp returns the current obj temp reading.

func (*TMP006) ObjTemps Uses

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

ObjTemps returns a channel to fetch obj temps from.

func (*TMP006) Present Uses

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

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

func (*TMP006) RawDieTemp Uses

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

RawDieTemp returns the current raw die temp reading.

func (*TMP006) RawDieTemps Uses

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

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

func (*TMP006) Start Uses

func (d *TMP006) Start() error

Start starts the data acquisition loop.

Package tmp006 imports 7 packages (graph). Updated 2016-08-02. Refresh now. Tools for package owners.