|
|
|
|
|
|
|
|
pinMode(pin, INPUT); |
|
|
pinMode(pin, INPUT); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
void meassure() { |
|
|
|
|
|
|
|
|
void measure() { |
|
|
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){ |
|
|
|
|
|
|
|
|
// Add the main program code into the continuous loop() function |
|
|
// Add the main program code into the continuous loop() function |
|
|
void loop() |
|
|
void loop() |
|
|
{ |
|
|
{ |
|
|
anemometer_1.meassure(); |
|
|
|
|
|
anemometer_2.meassure(); |
|
|
|
|
|
anemometer_3.meassure(); |
|
|
|
|
|
|
|
|
anemometer_1.measure(); |
|
|
|
|
|
anemometer_2.measure(); |
|
|
|
|
|
anemometer_3.measure(); |
|
|
|
|
|
|
|
|
if (second() != last_second) { |
|
|
if (second() != last_second) { |
|
|
every_second(); |
|
|
every_second(); |