Connect them to GND.
I add a pullup resistor because they tend to tease, but it should not be necessary.
Regards
Morten
I add a pullup resistor because they tend to tease, but it should not be necessary.
Regards
Morten
If this is your first visit, be sure to check out the FAQ. You must register before you can post.
IMPORTANT: Your first post will be checked for appropriate content. This may take a bit of time.
volatile byte count; unsigned int duration; unsigned long timePrevious; float windSpeed = 0; int windVein = 0; void setup() { Serial.begin(9600); attachInterrupt(0, arduino_anemometer, RISING); count = 0; duration = 0; timePrevious = 0; } void loop() { windVein = (analogRead(windVein)); if (count >= 1) { duration = (millis() - timePrevious); timePrevious = millis(); count = 0; windSpeed = (1492/duration); Serial.print(windSpeed,DEC); Serial.print(" MPH"); Serial.print(","); Serial.println(windVein); } } void arduino_anemometer() { count++;
volatile byte count; unsigned int duration; unsigned long timePrevious; float windSpeed = 0; int windVein = 0; void setup() { Serial.begin(9600); attachInterrupt(0, arduino_anemometer, RISING); count = 0; duration = 0; timePrevious = 0; } void loop() { windVein = (analogRead(windVein)); if (count >= 1) { duration = (millis() - timePrevious); timePrevious = millis(); count = 0; windSpeed = (1492/duration); Serial.print(windSpeed,DEC); Serial.print(" MPH"); Serial.print(","); Serial.println(windVein); } } void arduino_anemometer() { count++;
Comment