Documentation ¶
Overview ¶
Package am2320 contains the Code to read Temperature and Humidity from the environment with the Aosong AM2320 sensor. Please see the Datasheet for more information: https://akizukidenshi.com/download/ds/aosong/AM2320.pdf
Index ¶
Constants ¶
const (
// DefaultI2CAddr is the default Address of the AM2320.
DefaultI2CAddr = 0x5c
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Sensor ¶
type Sensor struct {
// contains filtered or unexported fields
}
Sensor which represents the I²C Device.
func Create ¶
Create the sensor which read Temperature and Humidity from the given I²C Device. In most cases you should use DefaultI2CAddr as address.
func (Sensor) Read ¶
func (sensor Sensor) Read() (*SensorValues, error)
Read is used to read the actual Temperature and Humidity from the AM2320 Sensor
type SensorValues ¶
type SensorValues struct {
Temperature, Humidity float32
}
SensorValues contains the results of reading the current Temperature and Humidity detected by the Sensor.
The Temperature is in °C between -40 to 80 Humidity is in % between 100 and 0