Changed windspeed tp m/s

This commit is contained in:
Kai Lauterbach 2022-05-18 19:08:55 +02:00
parent 3ee77e178f
commit 7d561546ed
2 changed files with 9 additions and 5 deletions

View file

@ -27,10 +27,14 @@
#define WIFI_MINIMUM_SIGNAL_QUALITY 10 // percent #define WIFI_MINIMUM_SIGNAL_QUALITY 10 // percent
#define RESET_ESP_TIME_INTERVAL_MS 3600000 #define RESET_ESP_TIME_INTERVAL_MS 3600000
#define ROTOR_LENGTH_KM 0.0000825
#define WIND_SENSOR_MEAS_TIME_S 5.0 #define WIND_SENSOR_MEAS_TIME_S 5.0
#define ROTOR_LENGTH_CM 8.25
#define ROTOR_LENGTH_M (ROTOR_LENGTH_CM / 100.0)
#define ROTOR_LENGTH_KM (ROTOR_LENGTH_M / 1000.0)
#define SEC_TO_HOUR_FACTOR (60.0 * 60.0) #define SEC_TO_HOUR_FACTOR (60.0 * 60.0)
#define COUNT_TO_KMH ((TWO_PI * ROTOR_LENGTH_KM / WIND_SENSOR_MEAS_TIME_S) * SEC_TO_HOUR_FACTOR) #define COUNT_TO_KMH ((TWO_PI * ROTOR_LENGTH_KM / WIND_SENSOR_MEAS_TIME_S) * SEC_TO_HOUR_FACTOR)
#define COUNT_TO_MPS (TWO_PI * ROTOR_LENGTH_M / WIND_SENSOR_MEAS_TIME_S)
#define WINDSPEED_FACTOR COUNT_TO_MPS
#define BAT_LOW_VOLTAGE 3.6 #define BAT_LOW_VOLTAGE 3.6
#define BAT_EMERGENCY_DEEPSLEEP_VOLTAGE 3.5 #define BAT_EMERGENCY_DEEPSLEEP_VOLTAGE 3.5

View file

@ -23,7 +23,7 @@ float wind_speed()
detachInterrupt(interruptNumber); detachInterrupt(interruptNumber);
// calculate the speed as km/h // calculate the speed as km/h
float tmp_speed = (float)anemometerRotations * COUNT_TO_KMH; float tmp_speed = (float)anemometerRotations * WINDSPEED_FACTOR;
#ifdef DEBUG #ifdef DEBUG
Serial.print("Windspeed: " + String(tmp_speed)); Serial.print("Windspeed: " + String(tmp_speed));