 
 void anemometerClick()
 {
-  long thisTime=millis()-anem_last;
-    anem_count++;
-  anem_last=millis();
-    
-    if(thisTime<anem_min)
-    {
-      anem_min=thisTime;
-    }
- 
+  long thisTime = millis() - anem_last;
+  anem_count++;
+  anem_last = millis();
+
+  if (thisTime < anem_min)
+  {
+    anem_min = thisTime;
+  }
+
 }
 
 void rainGageClick()
 {
-    long thisTime=millis()-rain_last;
-    if(thisTime>10)
-    {
-    rain_last=millis();      
-      rain_count++;
-    }
+  long thisTime = millis() - rain_last;
+  if (thisTime > 10)
+  {
+    rain_last = millis();
+    rain_count++;
+  }
 }
 
 void setup() {
 #ifdef WINC_EN
   pinMode(WINC_EN, OUTPUT);
   digitalWrite(WINC_EN, HIGH);
-#endif    
+#endif
   Serial.begin(9600);
   Serial.println("Starting...");
   pinMode(VBATPIN, INPUT);
   pinMode(SOLAR_PIN, INPUT);
 
   initializeSensors();
-  
+
   // check for the presence of the shield:
   if (WiFi.status() == WL_NO_SHIELD) {
     Serial.println("WiFi shield not present");

#define WINC_EN   2


volatile unsigned long rain_count=0;
volatile unsigned long rain_last=0;
volatile unsigned long anem_count=0;
volatile unsigned long anem_last=0;
volatile unsigned long anem_min=0xffffffff;
static const int vaneValues[] PROGMEM={66,84,92,127,184,244,287,406,461,600,631,702,786,827,889,946};
static const int vaneDirections[] PROGMEM={1125,675,900,1575,1350,2025,1800,225,450,2475,2250,3375,0,2925,3150,2700};

Adafruit_SHT31 sht31 = Adafruit_SHT31();
Adafruit_BMP085_Unified bmp180 = Adafruit_BMP085_Unified(10085);
Adafruit_WINC1500 WiFi(WINC_CS, WINC_IRQ, WINC_RST);
Adafruit_VEML6070 veml6070 = Adafruit_VEML6070();
Adafruit_TSL2561_Unified tsl = Adafruit_TSL2561_Unified(TSL2561_ADDR_FLOAT, 12345);

char ssid[] = "wpa.quade.local";      // your network SSID (name)
char pass[] = "aWq$HDvYE0Zn";   // your network password

#define VANE_PIN A1
#define SOLAR_PIN A2
#define RAIN_GAUGE_PIN 11
#define DHTPIN            9
#define DHTTYPE           DHT22

#define RAIN_FACTOR 0.2794
#define WIND_FACTOR 2.4
