Package tmp006 allows interfacing with the TMP006 thermopile.



    This section is empty.


    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.


    This section is empty.


    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.

                      Source Files