#include "CayenneDefines.h" #include "BlynkSimpleEsp8266.h" #include "CayenneWiFiClient.h" #define CAYANNE_DEBUG #define CAYANNE_PRINT Serial char token[] = "xxxxxxxxx"; const char* ssid = "xxxxxxxxxxxx"; const char* password = "xxxxxxxxxxxxxx"; #define VIRTUAL_PIN V1 void setup() { Serial.begin(115200); Serial.println(); Serial.println("setup"); Cayenne.begin(token, ssid, password); Serial.printf("Cayenne connected in %i ms\n", millis()); } volatile boolean readingSent = false; unsigned long tx; void loop() { if (readingSent) { Serial.printf("Reading sent in %i ms, going to sleep for 60 secs...\n", millis()); ESP.deepSleep(60 * 1000000); } Cayenne.run(); } CAYENNE_OUT(VIRTUAL_PIN) { float x = millis() / 1000.0; Cayenne.celsiusWrite(VIRTUAL_PIN, x); Serial.printf("Sent %f\n", x); readingSent = true; }