adt7410

package
v0.10.0 Latest Latest
Warning

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

Go to latest
Published: Jan 31, 2020 License: BSD-3-Clause Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Default I2C address
	Address = 0x48

	// Temperature Value MSB Register
	RegTempValueMSB = 0x0

	// Temperature Value LSB Register
	RegTempValueLSB = 0x1

	// Status Register
	RegStatus = 0x2

	// Config Register
	RegConfig = 0x3

	// ID Register
	RegID = 0x0B

	// Software Reset Register
	RegReset = 0x2F
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Device

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

func New

func New(i2c *machine.I2C, addressBits uint8) *Device

New returns ADT7410 device for the provided I2C bus and address. The ADT7410 has a default address of 0x48 (1001000). The last 2 bits of the address can be set using by connecting to the A1 and A0 pins to VDD or GND (for a total of up to 4 devices on a I2C bus). Also note that 10k pullups are recommended for the SDA and SCL lines.

func (*Device) Configure

func (dev *Device) Configure() (err error)

func (*Device) ReadTempC

func (d *Device) ReadTempC() float32

ReadTempC returns the value in the temperature value register, in Celcius

func (*Device) ReadTempF

func (d *Device) ReadTempF() float32

ReadTempF returns the value in the temperature value register, in Fahrenheit

func (*Device) ReadTemperature

func (d *Device) ReadTemperature() (temperature int32, err error)

ReadTemperature returns the temperature in celsius milli degrees (ºC/1000)

type Error

type Error uint8
const (
	ErrInvalidID Error = 0x1
)

func (Error) Error

func (e Error) Error() string

Jump to

Keyboard shortcuts

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