mcp9808

package module
v0.0.0-...-b31c678 Latest Latest
Warning

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

Go to latest
Published: Oct 8, 2018 License: Apache-2.0 Imports: 5 Imported by: 0

README

mcp9808

golang API for MCP9808 temperature sensor.

Documentation

Overview

Package mcp9808 provides a API for using a I²C(i2c) temperature sensor MCP9008.

Index

Constants

View Source
const (
	MCP9808_I2CADDR_DEFAULT  byte = 0x18
	MCP9808_REG_CONFIG       byte = 0x01
	MCP9808_REG_AMBIENT_TEMP byte = 0x05
	MCP9808_REG_MANUF_ID     byte = 0x06
	MCP9808_REG_DEVICE_ID    byte = 0x07
	MCP9808_REG_RESOLUTION   byte = 0x08
)

Variables

This section is empty.

Functions

func Address

func Address(address uint16) func(*MCP9808) error

Address sets the i2c address in not using the default address of 0x40

Types

type MCP9808

type MCP9808 struct {
	Temperature float64
	// contains filtered or unexported fields
}

func New

func New(b i2c.Bus, opts ...func(*MCP9808) error) (*MCP9808, error)

func (*MCP9808) Temp

func (m *MCP9808) Temp() (float64, error)

Jump to

Keyboard shortcuts

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