converting adafruit dht driver into c++