WeatherMeters
Arduino library for processing wind speed, wind wane and rain gauge sensors (WH 1080, Sparkfun)
Install / Use
/learn @pilotak/WeatherMetersREADME
Weather Meters
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
#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 directions
void 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);
}
Related Skills
node-connect
343.3kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
92.1kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
343.3kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
qqbot-media
343.3kQQBot 富媒体收发能力。使用 <qqmedia> 标签,系统根据文件扩展名自动识别类型(图片/语音/视频/文件)。
