
org.berry120.vueloop.WeatherLinkExample Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of VueLoop Show documentation
Show all versions of VueLoop Show documentation
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