← Back

ofxAbstractWeather

github.com/pce/ofxAbstractWeather · @pce
OF 0.11 Releases Web/Networking Utilities Bridges

weather for openframeworks, current providers: openweathermap

8 0 Last commit 3y ago Created 4y ago

README

ofxAbstractWeather



Introduction

OpenFrameworks Weather-Data addon.

Usage/Examples



Create an API-Key at OpenWeatherMap or weather.setHasLocalFile(true) loads for example: bin/data/openweathermap.json

``c++ void ofApp::setup(){ weather.setApiKey(apiKey); weather.setCityAndCountryCode(cityAndCountryCode); weather.parseData(weather.loadData()); }

void ofApp::update(){ currentTemperature = weather.getCurrentTemperature(); currentHumidity = weather.getCurrentHumidity(); currentWindSpeed = weather.getCurrentWindSpeed(); currentWindDirection = weather.getCurrentWindDirection(); currentClouds = weather.getCurrentClouds(); currentRain = weather.getPrecipitation(); currentAvg = weather.getAverageTemperature(); currentTempTrend = weather.getTemperatureTrend(); currentAvgRain = weather.getAveragePrecipitation(); }

example_openweathermap


Optional: Set Units of Measurement

c++ // temperature in Celsius use "metric" (default) // in Fahrenheit use "imperial", in Kelvin "standard" weather.setUnits("standard");
`

License

MIT License

Installation

Just drop the folder into the
openFrameworks/addons/` folder.

Dependencies

No Dependencies.

Compatibility

Tested with OF 0.11.2

Known issues

Roadmap



Version history

Version 0.2 (2021-12-16):





Version 0.1 (2021-12-15):





Get this addon

HTTPS
SSH

Latest release

v0.0.2 published 4y ago


  • added humidity
  • added local file support (example loads a cached json)


Full Changelog: https://github.com/pce/ofxAbstractWeather/compare/v0.0.1...v0.0.2