Created
September 19, 2017 15:07
-
-
Save mikebranstein/239a5a2d318e569df43ce55ff9e12e65 to your computer and use it in GitHub Desktop.
Main weather monitor app
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "weather-service.h" | |
#define MINUTES_TO_SLEEP (15*60) | |
WeatherService weatherService; | |
// setup() runs once, when the device is first turned on. | |
void setup() { | |
// initialize the weather service, true = debug, false = production | |
weatherService.init(false); | |
} | |
// loop() runs over and over again, as quickly as it can execute. | |
void loop() { | |
char* json = weatherService.getWeatherData(); | |
Particle.publish("w", json, PRIVATE); | |
System.sleep(weatherService.getRainGaugeSignalPin(), FALLING, MINUTES_TO_SLEEP); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment