Simple library for the AM2320 Temperature and humidity sensor using the Atmega328p MCU.
Basic example of reading the Temperature and Humidity data from the AM2320 sensor:
i2c_init();
float temp = 0.0;
float humi = 0.0;
while(1) {
AM2320_update_temperature_humidity();
temp = AM2320_get_temperature_float();
humi = AM2320_get_humidity_float();
**DO STUFF WITH READINGS**
**delay at least 2 seconds**
}
The datasheet reccomends at least a 2 second interval between readings as this reduces the amount of heat generated by the component allowing for more accurate readings.