Documentation ¶
Index ¶
- Constants
- Variables
- type Device
- func (d *Device) Celsius() float32
- func (d *Device) Configure()
- func (d *Device) DeciCelsius() int32
- func (d *Device) DeciRelHumidity() int32
- func (d *Device) RawHumidity() uint32
- func (d *Device) RawTemp() uint32
- func (d *Device) Read() error
- func (d *Device) RelHumidity() float32
- func (d *Device) Reset()
- func (d *Device) Status() byte
Constants ¶
View Source
const ( Address = 0x38 CMD_INITIALIZE = 0xBE CMD_STATUS = 0x71 CMD_TRIGGER = 0xAC CMD_SOFTRESET = 0xBA STATUS_BUSY = 0x80 STATUS_CALIBRATED = 0x08 )
Variables ¶
View Source
var ( ErrBusy = errors.New("device busy") ErrTimeout = errors.New("timeout") )
Functions ¶
This section is empty.
Types ¶
type Device ¶
type Device struct { Address uint16 // contains filtered or unexported fields }
Device wraps an I2C connection to an AHT20 device.
func New ¶
New creates a new AHT20 connection. The I2C bus must already be configured.
This function only creates the Device object, it does not touch the device.
func (*Device) DeciCelsius ¶
Temperature in mutiples of one tenth of a degree celsius
Using this method avoids floating point calculations.
func (*Device) DeciRelHumidity ¶
func (*Device) RawHumidity ¶
func (*Device) Read ¶
Read the temperature and humidity
The actual temperature and humidity are stored and can be accessed using `Temp` and `Humidity`.
func (*Device) RelHumidity ¶
Click to show internal directories.
Click to hide internal directories.