@wvmarle
You are perfectly wright. Summing up the A/D values into an unsgined long has a greater capaciy. 86400 seconds * 1023 equals 88 387 200 and that is safe.
I'd actually store the values *100 so you don't lose too much accuracy in case of very low wind speeds.
WaWa's code from #11 would then become:
int rawValue;
float currentWindSpeed, windRun;
unsigned long totalWindSpeed;
void loop() {
if (onesecondhaspassed) {
rawValue = analogRead(A0);
currentWindSpeed = rawValue * 17.6; // in dm/h
totalWindSpeed += rawValue; // add each new value
}
if (midnight) {
windRun = totalWindSpeed / 2046000; // in km
totalWindSpeed = 0; // reset
}
}