We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 17f2732 commit 00578a3Copy full SHA for 00578a3
aht20/aht20.go
@@ -29,7 +29,7 @@ func New(bus drivers.I2C) Device {
29
func (d *Device) Configure() {
30
// Check initialization state
31
status := d.Status()
32
- if status&0x08 == 1 {
+ if status&STATUS_CALIBRATED == 1 {
33
// Device is initialized
34
return
35
}
@@ -69,7 +69,7 @@ func (d *Device) Read() error {
69
70
71
// If measurement complete, store values
72
- if data[0]&0x04 != 0 && data[0]&0x80 == 0 {
+ if data[0]&STATUS_CALIBRATED != 0 && data[0]&STATUS_BUSY == 0 {
73
d.humidity = uint32(data[1])<<12 | uint32(data[2])<<4 | uint32(data[3])>>4
74
d.temp = (uint32(data[3])&0xF)<<16 | uint32(data[4])<<8 | uint32(data[5])
75
return nil
0 commit comments