#include "libdht.h" #include #include #include int getdhtstring(int PIN, char* string) { float humid; float temp; while (1) { if (pi_2_dht_read(PIN, PIN, &humid, &temp) == DHT_SUCCESS) { sprintf(string, "{\"humidity\": %.1f, \"temp\": %.1f}", humid, temp); break; } } return 0; }