/* * Microview Meteo Station * by Giovanni Gentile * 01-01-17 * See the complete tutorial on Instructables * www.projectg.it * www.0lab.it */ #include // include MicroView library #include "DHT.h" MicroViewWidget *widget, *widget2; // declare widget pointer #define DHTPIN 2 #define DHTTYPE DHT11 DHT dht(DHTPIN, DHTTYPE); void setup () { uView.begin(); // start MicroView uView.clear(PAGE); // clear page widget = new MicroViewSlider(0,0,0,50,WIDGETSTYLE2); // declare as gauge widget //uView.drawChar(47,33,67); // Character C is ASCII code 67 widget2 = new MicroViewSlider(0,30,0,100,WIDGETSTYLE2); dht.begin(); delay(2000); } void loop () { int h = dht.readHumidity(); int mh = h+(h*0.43); // Adjust the Humi value + 43% delay(20); int t = dht.readTemperature(); int mt = t-(t*0.13); // Adjust the Temp value - 13% widget->setValue(mt); widget2->setValue(mh); uView.display(); delay (2000); }