https://github.com/pilotak/weathermeters
Arduino library for processing wind speed, wind wane and rain gauge sensors (WH 1080, Sparkfun)
https://github.com/pilotak/weathermeters
arduino arduino-library esp32 esp8266 meteo rain-gauge rainmeter weather wh1080 winddirection windspeed
Last synced: about 1 month ago
JSON representation
Arduino library for processing wind speed, wind wane and rain gauge sensors (WH 1080, Sparkfun)
- Host: GitHub
- URL: https://github.com/pilotak/weathermeters
- Owner: pilotak
- License: mit
- Created: 2018-05-19T20:18:06.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2023-05-13T20:00:52.000Z (about 2 years ago)
- Last Synced: 2025-03-28T03:41:20.876Z (about 2 months ago)
- Topics: arduino, arduino-library, esp32, esp8266, meteo, rain-gauge, rainmeter, weather, wh1080, winddirection, windspeed
- Language: C++
- Homepage:
- Size: 36.1 KB
- Stars: 16
- Watchers: 2
- Forks: 6
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Weather Meters
[](https://github.com/pilotak/WeatherMeters/actions)
[](https://arduino.cc)Arduino library for processing wind speed, wind wane and rain gauge sensors (WH1080, WH1090, Sparkfun)
It's interupt based library with callbacks and ready to use on any board. The only difference accros boards would be in initializing 1 second timer, ie. on STM32 you could use RTC timer, ESP32 has its own timer object, Timer1 could be used Arduino Uno (ATmega328P) etc please see `examples/timers`
# Example
```cpp
#include "WeatherMeters.h"const int windvane_pin = A0;
const int anemometer_pin = 2;
const int raingauge_pin = 3;// filter array = "binary" length only: 2, 4, 8, 16, 32, 64, 128, etc.
WeatherMeters <4> meters(windvane_pin); // filter last 4 directionsvoid intAnemometer() {
meters.intAnemometer();
}void intRaingauge() {
meters.intRaingauge();
}void setup() {
Serial.begin(115200);attachInterrupt(digitalPinToInterrupt(anemometer_pin), intAnemometer, FALLING);
attachInterrupt(digitalPinToInterrupt(raingauge_pin), intRaingauge, FALLING);
}void loop() {
Serial.print(F("Wind degrees: "));
Serial.print(meters.getDir(), 1);
Serial.print(F(" Wind speed: "));
Serial.print(meters.getSpeed(), 1);
Serial.print(F("km/h, Rain: "));
Serial.print(meters.getRain(), 4);
Serial.println(F("mm"));delay(8000);
}
```