Hallo,
ich will gerne einen Windmesser (TX174 von Technoline) mit Tasmota einbinden, leider habe ich keine Ahnung wie man das macht.
In einem anderen Projekt (http://www.wettermonster.de) habe ich etwas Code dazu gefunden, wäre es möglich diesen zu verwenden?
Grüße
Gerald
Code
void readWeatherMeters() {
windSpeed = (numRevsAnemometer / (interval * 60)) * 2.4;
numRevsAnemometer = 0;
Percipitation = 0.2794 * (numClicksRain * 60 / interval);
numClicksRain = 0;
int windDirectionVoltage = analogRead(A0);
if (windDirectionVoltage >= 212 && windDirectionVoltage < 273) {windDirection = "N";}
else if (windDirectionVoltage >= 577 && windDirectionVoltage < 665) {windDirection = "NNE";}
else if (windDirectionVoltage >= 483 && windDirectionVoltage < 577) {windDirection = "NE";}
else if (windDirectionVoltage >= 929 && windDirectionVoltage < 943) {windDirection = "ENE";}
else if (windDirectionVoltage >= 906 && windDirectionVoltage < 929) {windDirection = "E";}
else if (windDirectionVoltage >= 943 && windDirectionVoltage < 1023){windDirection = "ESE";}
else if (windDirectionVoltage >= 795 && windDirectionVoltage < 858) {windDirection = "SE";}
else if (windDirectionVoltage >= 858 && windDirectionVoltage < 906) {windDirection = "SSE";}
else if (windDirectionVoltage >= 665 && windDirectionVoltage < 748) {windDirection = "S";}
else if (windDirectionVoltage >= 748 && windDirectionVoltage < 795) {windDirection = "SSW";}
else if (windDirectionVoltage >= 348 && windDirectionVoltage < 399) {windDirection = "SW";}
else if (windDirectionVoltage >= 399 && windDirectionVoltage < 483) {windDirection = "WSW";}
else if (windDirectionVoltage >= 0 && windDirectionVoltage < 106) {windDirection = "W";}
else if (windDirectionVoltage >= 163 && windDirectionVoltage < 212) {windDirection = "WNW";}
else if (windDirectionVoltage >= 106 && windDirectionVoltage < 163) {windDirection = "NW";}
else if (windDirectionVoltage >= 273 && windDirectionVoltage < 348) {windDirection = "NNW";}
}
##PIN definition Windgeschwindigkeit
pinMode(14, INPUT_PULLUP);
attachInterrupt(14, countAnemometer, FALLING);
Alles anzeigen