pyupm_am2315 module

class pyupm_am2315.AM2315(bus, devAddr=92)[source]

Bases: object

API for the AM2315 Temperature & Humidity Sensor.

ID: am2315

Name: Digital Temperature and Humidity Sensor

Category: temp

Manufacturer: adafruit

Link:http://www.adafruit.com/products/1293

Connection: i2c AM2315 by Measurement Specialties (http://www.aosong.com/asp_bin/Products/en/AM2315.pdf) is a digital humidity sensor with temperature output. RH reports between 0 and 100%, and the temperature range is -40 to +125 degC. The sampling period of this sensor is 2 seconds. Reads occurring more often than that return cached data.

C++ includes: am2315.hpp

getHumidity()[source]

float getHumidity(void)

Gets the current measured humidity [RH]

Data is updated every 2 seconds - accesses occurring more often than that return cached data

getTemperature()[source]

float getTemperature(void)

Gets the humidity cell temperature [degC]

Data is updated every 2 seconds - accesses occurring more often than that return cached data

getTemperatureF()[source]

float getTemperatureF(void)

Gets the humidity cell temperature [degF]

Data is updated every 2 seconds - accesses occurring more often than that return cached data

i2cReadReg_16(reg)[source]

uint16_t i2cReadReg_16(int reg)

Reads a two-byte register

reg: Address of the register

i2cReadReg_32(reg)[source]

uint32_t i2cReadReg_32(int reg)

Reads a four-byte register

reg: Address of the register

i2cReadReg_8(reg)[source]

uint8_t i2cReadReg_8(int reg)

Reads a one-byte register

reg: Address of the register

i2cWriteReg_16(reg, ival)[source]

int i2cWriteReg_16(int reg, uint16_t ival)

Writes a two-byte (16b) register

reg: Address of the register

ival: 16b value

i2cWriteReg_32(reg, ival)[source]

int i2cWriteReg_32(int reg, uint32_t ival)

Writes a four-byte (32b) register

Note: these access routines are not the normal accesses to an I2C device. AM2315 contains a microcontroller that manages the actual readings. These handlers then make requests over I2C using a protocol defined by AM2315.

reg: Address of the register

ival: 32b value

i2cWriteReg_8(reg, ival)[source]

int i2cWriteReg_8(int reg, uint8_t ival)

Writes a one-byte (8b) register

reg: Address of the register

ival: 8b value

testSensor()[source]

int testSensor(void)

Function intended to test the device and verify it is operating correctly.