HTTPS SSH

This library provides support for the weather station sold by Sparkfun. See the spec for connecting guidelines.

Tested with arduino IDE ver. 1.0

Usage

Something along the lines of:

hg clone http://bitbucket.org/hadara/arduino-weather
cp -R arduino-weather <your_arduino_directory>/libraries/Weather

By default the library assumes that you have connected anemometer to digital pin 3, rain gauge to digital pin 2 and wind vane to to analog pin 3. You can override the pins with arguments to the initialize() function but keep in mind that digital pins have to be able to rise interrupts so on Atmega328 based boards like Arduino Uno this usually means only pins 2 and 3 are usable. See reference for usable pins on Arduino Mega.

#include <TimerOne.h>
#include <Weather.h>

#define SERIAL_BAUDRATE 9600

void setup() {
    weather.initialize(3, 2, 3);
    Serial.begin(SERIAL_BAUDRATE);
}

void loop() {
    Serial.print(weather.wind_direction_degs());
    Serial.print(" ");
    Serial.print(weather.wind_direction_name());
    Serial.print(" ");
    Serial.print(weather.wind_speed);
    Serial.print(" ");
    Serial.print(weather.total_rainfall());
    Serial.println();

    delay(1000);
}