Documentation ¶
Overview ¶
Package adt7410 provides a driver for the adt7410 I2C Temperature Sensor.
Datasheet: https://www.analog.com/media/en/technical-documentation/data-sheets/ADT7410.pdf
Index ¶
Constants ¶
const ( // Address is default I2C address. Address = 0x48 // Address1 is for first device, aka the default. Address1 = Address // Address2 is for second device. Address2 = 0x49 // Address3 is for third device. Address3 = 0x4A // Address4 is for fourth device. Address4 = 0x4B // Temperature Value MSB Register RegTempValueMSB = 0x0 // Temperature Value LSB Register RegTempValueLSB = 0x1 // Status Register RegStatus = 0x2 // Config Register RegConfig = 0x3 // THIGH setpoint most significant byte 0x20 (64°C) RegTHIGHMsbReg = 0x4 // THIGH setpoint least significant byte 0x00 (64°C) RegTHIGHLsbReg = 0x5 // TLOW setpoint most significant byte 0x05 (10°C) RegTLOWMsbReg = 0x6 // TLOW setpoint least significant byte 0x00 (10°C) RegTLOWLsbReg = 0x7 // TCRIT setpoint most significant byte 0x49 (147°C) RegTCRITMsbReg = 0x8 // TCRIT setpoint least significant byte 0x80 (147°C) RegTCRITLsbReg = 0x9 // THYST setpoint 0x05 (5°C) RegTHYSTReg = 0xA // ID Register (0xCx) RegID = 0x0B // Software Reset Register RegReset = 0x2F )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Device ¶
type Device struct { Address uint8 // contains filtered or unexported fields }
func New ¶
New returns ADT7410 device for the provided I2C bus using default address. of 0x48 (1001000). To use multiple ADT7410 devices, 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) ReadTempC ¶
ReadTempC returns the value in the temperature value register, in Celsius.
func (*Device) ReadTempF ¶
ReadTempF returns the value in the temperature value register, in Fahrenheit.
func (*Device) ReadTemperature ¶
ReadTemperature returns the temperature in celsius milli degrees (°C/1000)