|
|
|
|
|
|
|
|
|
|
|
|
|
|
#include <SdFat.h> |
|
|
#include <SdFat.h> |
|
|
#include <TimeLib.h> |
|
|
#include <TimeLib.h> |
|
|
#include <Bounce.h> |
|
|
|
|
|
|
|
|
|
|
|
#define SD_FAT_TYPE 3 |
|
|
#define SD_FAT_TYPE 3 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void setup_anemometer(int pin) { |
|
|
void setup_anemometer(int pin) { |
|
|
anemometer_pin = pin; |
|
|
anemometer_pin = pin; |
|
|
pinMode(pin, INPUT); |
|
|
pinMode(pin, INPUT); |
|
|
//this->reed_contact = Bounce(pin, 1); |
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
void meassure() { |
|
|
void meassure() { |
|
|
/*if (reed_contact.update() && reed_contact.fallingEdge()) { |
|
|
|
|
|
count_per_second++; |
|
|
|
|
|
}*/ |
|
|
|
|
|
short int milli = millis(); |
|
|
short int milli = millis(); |
|
|
if(last_milli != milli){ |
|
|
if(last_milli != milli){ |
|
|
if(digitalRead(anemometer_pin) == HIGH){ |
|
|
if(digitalRead(anemometer_pin) == HIGH){ |
|
|
|
|
|
|
|
|
int anemometer_pin; |
|
|
int anemometer_pin; |
|
|
int last_milli; |
|
|
int last_milli; |
|
|
|
|
|
|
|
|
//Bounce reed_contact = Bounce(2, 1); |
|
|
|
|
|
|
|
|
|
|
|
calculations values[60]; |
|
|
calculations values[60]; |
|
|
|
|
|
|
|
|
}anemometer_1, anemometer_2, anemometer_3; |
|
|
}anemometer_1, anemometer_2, anemometer_3; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public: |
|
|
public: |
|
|
void measure() { |
|
|
void measure() { |
|
|
//digitalWrite(power_Windfahne, HIGH); |
|
|
|
|
|
wind_sec = map(analogRead(Windfahne), 0, 1023, 20, 350); |
|
|
wind_sec = map(analogRead(Windfahne), 0, 1023, 20, 350); |
|
|
//digitalWrite(power_Windfahne, LOW); |
|
|
|
|
|
wind_summ += wind_sec; |
|
|
wind_summ += wind_sec; |
|
|
saved_seconds++; |
|
|
saved_seconds++; |
|
|
} |
|
|
} |