

This function is useful if you need to decrease the amount of time between readings or to save power. By default the sensor will be in its highest resolution settings. The vast majority of users do not need to change the resolution. SetResolution() allows the user to change the humidity and temperature resolution. It’s highly unlikely that you will ever see a bad CRC, but the library supports CRC checking. The HTU21D calculates an internal CRC and transmits it along with the temperature and humidity readings.

These are generally not used by regular users but are documented here in case you need them: The library and example code demonstrate some of the smaller functions supported by the HTU21D. You will see the current humidity and temperature in the room! Explanation of Functions: Once your code is uploaded, open the serial terminal at 9600bps. SCL = A5 (use inline 10k resistor if your board is 5V)įloat temp = myHumidity.readTemperature() SDA = A4 (use inline 10k resistor if your board is 5V) Hardware Connections (Breakoutboard to Arduino): Open serial monitor at 9600 baud to see readings. Uses the HTU21D library to display the current humidity and temperature License: This code is public domain but you buy me a beer if you use this and we meet someday (Beerware license). Load this example onto the Arduino, or copy from below. You should see the HTU21D_Humidity submenu. Once the library is installed, open the Arduino IDE, and expand the examples menu. The examples menu expanded to show Humidity example
