Documentation ¶
Index ¶
Constants ¶
View Source
const ( CMD_AM2320_READ_REGISTERS byte = 0x03 // Reading register data CMD_AM2320_WRITE_REGISTERS byte = 0x10 // Write multiple registers )
AM2320 command byte's sequences
View Source
const ( DHT12_HUM_INT = 0x00 DHT12_HUM_SCALE = 0x01 DHT12_TEMP_INT = 0x02 DHT12_TEMP_SCALE = 0x03 DHT12_CHECKSUM = 0x04 DHT12_DATA_BYTES = 5 DHT12_DATA_START = DHT12_HUM_INT )
DHT12 sensor memory map
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Sensor ¶
type Sensor struct {
// contains filtered or unexported fields
}
func NewSensor ¶
func NewSensor(sensorType SensorType) *Sensor
func (*Sensor) GetSensorType ¶
func (v *Sensor) GetSensorType() SensorType
type SensorAM2320 ¶
type SensorAM2320 struct { }
SensorAM2320 specific type
func (*SensorAM2320) ReadRelativeHumidityAndTemperatureMult10 ¶
type SensorDHT12 ¶
type SensorDHT12 struct { }
SensorDHT12 specific type
func (*SensorDHT12) ReadRelativeHumidityAndTemperatureMult10 ¶
type SensorInterface ¶
type SensorInterface interface {
ReadRelativeHumidityAndTemperatureMult10(i2c *i2c.I2C) (humidity int16, temperature int16, err error)
}
Abstract Aosong Electronics sensor interface to control and gather data via I2C-bus.
type SensorType ¶
type SensorType int
SensorType identify which Aosong Electronics humidity and temperature sensor is used. DHT12, AM2320 are supported.
const ( // Aosong Electronics humidity and temperature sensor model DHT12. DHT12 SensorType = iota // Aosong Electronics humidity and temperature sensor model AM2320. AM2320 )
Click to show internal directories.
Click to hide internal directories.