A Library to add support of HTU21D temperature and humidity sensor to Particle core (Formerly Spark Core).
Before your setup function
#include "HTU21D.h"
HTU21D htu = HTU21D();
In your setup function
// HT21D sensor setup
while(! htu.begin()){
Serial.println("Couldnt find HTU21D");
delay(1000);
}
In your loop you can now get values like that
temperature = htu.readTemperature();
humidity = htu.readHumidity();
The sensor offers 2 configurations: Maximum resolution : 12bits resolution for Relative humidity and 14bits for temperature or 11bit resolution for both temperature and relative humidity
// Set maximum resolution
htu.setResolution(HTU21D_RES_MAX);
// Set 11bits resolution
htu.setResolution(HTU21D_RES_11BITS);
- Fork it (https://github.com/romainmp/HTU21D/fork)
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create a new Pull Request