All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.berry120.vueloop.WeatherLinkExample Maven / Gradle / Ivy

Go to download

Simple Java library for getting weather data from the Vantage Vue weather station.

The newest version!
package org.berry120.vueloop;

import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Calendar;

/**
 * A simple example program.
 * @author Michael Berry
 */
public class WeatherLinkExample {
    
    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        VueLooper looper = new VueLooper("COM3");
        looper.loop((WeatherLoopPacket packet) -> {
            DateFormat dateFormat = new SimpleDateFormat("yyyy/MM/dd HH:mm:ss");
            Calendar cal = Calendar.getInstance();
            System.out.println("Received at " + dateFormat.format(cal.getTime()) + ". Bar: " + packet.getBarometerReading() + " Temp: " + packet.getOutsideTemperature() + " Hum: " + packet.getOutsideHumidity() + "% Forecast: " + packet.getForecast() + " Bat: " + packet.getTransmitterBatteryStatus());
        });
    }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy