Created
April 11, 2016 05:42
-
-
Save LarsBergqvist/bf6b17463bdfc33803a62767496b16b9 to your computer and use it in GitHub Desktop.
Adafuit_IO_REST_setup_and_loop
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
void setup() | |
{ | |
setupWiFi(); | |
aio.begin(); | |
dht.begin(); | |
float h = dht.readHumidity(); | |
float t = dht.readTemperature(); | |
sendDataToAdafruitIO(t,h); | |
// Put the board to deep sleep to save power. Will send a signal on D16 when it is time to wake up. | |
// Thus, connect D16 to the reset pin. After reset, setup will be executed again. | |
Serial.print("Going to deep sleep for "); | |
Serial.print(SLEEP_SECONDS); | |
Serial.println(" seconds"); | |
ESP.deepSleep(SLEEP_SECONDS * 1000000); | |
} | |
void loop() | |
{ | |
// nothing to do here as setup is called when waking up after deep sleep | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment