Documentation
¶
Index ¶
- Constants
- Variables
- type AHT20
- func (d *AHT20) Celsius() float32
- func (d *AHT20) Configure()
- func (d *AHT20) RawHumidity() uint32
- func (d *AHT20) RawTemp() uint32
- func (d *AHT20) Read() error
- func (d *AHT20) ReadWithRetry(i int) error
- func (d *AHT20) RelHumidity() float32
- func (d *AHT20) Reset()
- func (d *AHT20) Status() byte
- func (i *AHT20) Tx(w, r []byte) error
Constants ¶
View Source
const ( 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("AHT20 busy") ErrTimeout = errors.New("timeout") )
Functions ¶
This section is empty.
Types ¶
type AHT20 ¶
type AHT20 struct {
// contains filtered or unexported fields
}
AHT20 wraps an I2C connection(github.com/d2r2/go-i2c) to an AHT20 .
func AHT20New ¶
New creates a new AHT20 connection. The I2C bus must already be configured.
This function only creates the AHT20 object, it does not touch the AHT20.
func (*AHT20) RawHumidity ¶
func (*AHT20) Read ¶
Read the temperature and humidity
The actual temperature and humidity are stored and can be accessed using `Temp` and `Humidity`.
func (*AHT20) ReadWithRetry ¶
func (*AHT20) RelHumidity ¶
Click to show internal directories.
Click to hide internal directories.