Hi - this code below worked just fine with 0.4.0 but soon as I updated library it does not compile. Code below with console error messages below: using IDE 1.6.13 note: just test code so a little untidy.
// #define BLYNK_PRINT Serial // Defines the object that is used for printing
// #define BLYNK_DEBUG // Optional, this enablecs more detailed prints
#define THERMOSTAT_ONEWIRE_CODE // comment out if want to remove all code related to One Wire and thermostat
// #define DISPLAY_DEBUG // comment this to remove all of my code debug println to serial
// #define USE_ESP8266 // compile for esp8266 board
#define USE_MEGA2560 // compile for arduino mega2560 board https://www.arduino.cc/en/Main/ArduinoBoardMega2560
// #define WEMOS_D1_R2_MINI // comment this in if we are running a Wemos D1 R2 or Mini board
// #define WEMOS_D1_R1 // comment this in if we are running a Wemos D1 R1 board
#ifdef USE_ESP8266
#include <ESP8266WiFi.h>
#include <BlynkSimpleEsp8266.h>
#endif
#ifdef USE_MEGA2560
#include <Ethernet.h>
#include <BlynkSimpleEthernet.h>
#include <SPI.h>
// #include <stdint.h> // don't seem to need this for avr/wdt.h
#include <avr/wdt.h>
#endif
#ifdef USE_MEGA2560
char server[] = "www.google.com"; // name address for Google (using DNS)
// Set the static IP address to use if the DHCP fails to assign
// Initialize the Ethernet client library
// with the IP address and port of the server
// that you want to connect to (port 80 is default for HTTP):
EthernetClient client;
#endif
char source_filename[] = "filename";
char source_version[] = "version";
// #define WDTO_8S WDTO_8S // set watch dog timer period to xx seconds i.e. WDT0_xxS
// ====== PINS FOR WEMOS D1 MINI and D1 R2 ======
// for Wemos Mini D1 : All of the IO pins run at 3.3V :: All of the IO pins have interrupt/pwm/I2C/one-wire support except D0
// See: https://www.wemos.cc/product/d1-mini.html
// Some pins have pull down / pull up resistors to select the ESP866 boot mode:
/*
GPIO0 -> 10k pull up resistor -> 3V3
GPIO2 -> 10k pull up resistor -> 3V3
GPIO15 -> 10k pull down resistor -> GND
D0 / GPIO16 is special and used for waking from deep sleep.
TX and RX are the REPL UART pins.
There is only one analog pin available, marked as A0 on the D1 mini.
It is accessible via the ADC class as ADC(0)
Input voltage must be between 0 and 1v, which maps to 0-1024 (10 bit resolution).
*/
// Below Code from: https://github.com/esp8266/Arduino/blob/master/variants/d1_mini/pins_arduino.h
#ifdef WEMOS_D1_R2_MINI
// #ifndef Pins_Arduino_h
#define Pins_Arduino_h
#include "../generic/common.h"
#define PIN_WIRE_SDA (4)
#define PIN_WIRE_SCL (5)
static const uint8_t SDA = PIN_WIRE_SDA;
static const uint8_t SCL = PIN_WIRE_SCL;
static const uint8_t LED_BUILTIN = 2;
static const uint8_t BUILTIN_LED = 2;
static const uint8_t D0 = 16;
static const uint8_t D1 = 5;
static const uint8_t D2 = 4;
static const uint8_t D3 = 0;
static const uint8_t D4 = 2;
static const uint8_t D5 = 14;
static const uint8_t D6 = 12;
static const uint8_t D7 = 13;
static const uint8_t D8 = 15;
static const uint8_t RX = 3;
static const uint8_t TX = 1;
// for D1 R2 extra PINs repeat some of the above
static const uint8_t D9 = 2;
static const uint8_t D10 = 15;
static const uint8_t D11 = 13;
static const uint8_t D12 = 12;
static const uint8_t D13 = 14;
static const uint8_t D14 = 4;
static const uint8_t D15 = 5;
// #endif /* Pins_Arduino_h */
#endif // WEMOS D1 MINI or WEMOS D1 R2
// ====== PINS FOR WEMOS D1 R1 ======
/*
GPIO0 -> 10k pull up resistor -> 3V3
GPIO2 -> 10k pull up resistor -> 3V3
GPIO15 -> 10k pull down resistor -> GND
D0 / GPIO16 is special and used for waking from deep sleep.
*/
#ifdef WEMOS_D1_R1
// #ifndef Pins_Arduino_h
#define Pins_Arduino_h
#include "../generic/common.h"
#define PIN_WIRE_SDA (4)
#define PIN_WIRE_SCL (5)
static const uint8_t SDA = PIN_WIRE_SDA;
static const uint8_t SCL = PIN_WIRE_SCL;
static const uint8_t LED_BUILTIN = 2;//new ESP-12E GPIO2
static const uint8_t BUILTIN_LED = 2;//new ESP-12E GPIO2
static const uint8_t D0 = 3;
static const uint8_t D1 = 1;
static const uint8_t D2 = 16;
static const uint8_t D3 = 5;
static const uint8_t D4 = 4;
static const uint8_t D5 = 14;
static const uint8_t D6 = 12;
static const uint8_t D7 = 13;
static const uint8_t D8 = 0;
static const uint8_t D9 = 2;
static const uint8_t D10 = 15;
static const uint8_t D11 = 13;
static const uint8_t D12 = 12;
static const uint8_t D13 = 14;
static const uint8_t D14 = 4;
static const uint8_t D15 = 5;
// #endif /* Pins_Arduino_h */
#endif // WEMOS D1 R1
// ======================
// ===============================
#include <WidgetRTC.h>
#include <OneWire.h> // make sure used ESP OneWire.h file in ESP folder
#include <DallasTemperature.h>
#include <TimeLib.h>
#include <SimpleTimer.h>
#ifdef USE_ESP8266
#include <ArduinoOTA.h>
#endif
char Date[16];
char Time[16];
char ssid[] = "test";
char pass[] = "test";
bool SwitchOver = FALSE;
bool AutoMode = TRUE;
#define BLYNK_GREEN "#23C48E"
#define BLYNK_BLUE "#04C0F8"
#define BLYNK_YELLOW "#ED9D00"
#define BLYNK_RED "#D3435C"
#define BLYNK_DARK_BLUE "#5F7CD8"
//=== VARAIBLES FOR FLOW METER =====
// The hall-effect flow sensor outputs approximately 4.5 pulses per second per
// litre/minute of flow.
// External Interrupts: 2 (interrupt 0), 3 (interrupt 1), 18 (interrupt 5), 19 (interrupt 4), 20 (interrupt 3), and 21 (interrupt 2).
// These pins can be configured to trigger an interrupt on a low level, a rising or falling edge, or a change in level.
// See the attachInterrupt() function for details.
byte sensorInterrupt = 5; // 5 = digital pin 18 NEED TO CHECK WITH WITH MEGA, see above i.e. what PIN and Interrupt
byte sensorPin = 18;
float calibrationFactor = 4.8;
// Frequency: F=4.8 * Q (L / Min) error: ± 2% voltage: 3.5-24VDC, current can not exceed 10mA, 450 output pulses/liters,
// F=constant * units of flow (L / min) * time (seconds).
volatile byte pulseCount;
float flowRate = 0;
float flowMilliLitres;
float totalMilliLitres;
float totalLitres;
//float yesterday_totalLitres_used; // use this as a basis to calculate number of litres consumer today
//float today_totalLitres_used;
//int yesterday_day_number;
//int today_day_number;
int end_of_day_hour = 23; // we will usel this the end of day reading time since we don't expect any more water used from 23:00 to midnight ;-)
unsigned long oldTime;
unsigned long TargetVolume; //target volume amount set by blynk slider
//===================================
bool isFirstConnect = true; // assume this is first time we connected to Blynk
#define ONE_WIRE_BUS 8 // GPIO7 = for Mega Note: this would be PIN D?? on WeMos D1 R1 ESP8266 board
#define TEMPERATURE_PRECISION 12
#define RELAY1 7 // D7 NOTE: for Wemos D1 R1 Dxx will map to different GPIOs
#define RELAY2 6 // D6
#define RELAY3 5 // D5
#define RELAY4 4 // D4
int solenoid_1; // NOTE: *** in future need to create in an Array and allow user to select number of solenoids from Blynk setup
int solenoid_2; // ACTUALLY may be able to use buttonState_Relay1 ?
int solenoid_3;
int solenoid_4;
// **** NEED to determine PINS used by Ethernet Shield and 4 x Relay shield
// assume all buttons for all relays are off -- when we do a Sync it will refresh accordingly from blynkserver
boolean buttonState_Relay[20];
int max_number_of_solenoids_on;
int number_of_solenoids_on;
int number_of_zones;
#define number_of_thermostats 5 // Define how many thermostats this system has
#ifdef THERMOSTAT_ONEWIRE_CODE
DeviceAddress Thermo_0 = { 0x53 }; // Ambient or case temperature
DeviceAddress Thermo_1 = { 0x03, 0x5f };
DeviceAddress Thermo_2 = { 0x15, 0x01, 0x25 };
DeviceAddress Thermo_3 = { 0x01, 0xB3 };
DeviceAddress Thermo_4 = { 0x02, 0xCE };
DeviceAddress Thermo_5 = { 0x01, 0x4C };
DeviceAddress Thermo_10 = { 0x02, 0xCE };
// Below Thermostat device for VW Prestige
DeviceAddress Thermo_VW1 = {0x28, 0x16, 0x04, 0xBF}; //
DeviceAddress Thermo_VW2 = {0x28, 0xFF, 0x16, 0x03, 0xBF}; //
DeviceAddress Thermo_VW3 = {0x28, 0xFF, 0xAF, 0x35, 0xE2}; //
#endif
int rainSensePin_1= 0; // analog pin 0 - sensor i/p
int rainSensePin_2= 1; // analog pin 1
long BaudRate = 115200;
long sysTick = 0; // not sure what this is used for
char GotChar; // not sure what this used for
// int alertPin= 8; // digital pin 8 - alert o/p [not sure how its used ?]
int curCounter= 0; // current counter - goes up by 1 every second while sensing [not sure how its used ?]
SimpleTimer timer; // create a time object
int clockcounter = 3; // used for ESP clock setup
bool clock_sync = 0; // ?
bool Button1AlreadyPressed = 0; // not used
int Button1PressedTime = 0; // not used
int Button1ReleasedTime = 0; // not used
int DebounceDelay = 750; // not used
int AutoMode_timer = 0; // set to 0 first
float temp_roof_section[(number_of_thermostats+1)]; // array s always AMBIENT Temp Sensor
int temp_threshold; // the maximum temperature roof can be before the systutoMode
unsigned long spray_timeon[(number_of_thermostats+1)]; // array conds since board booted
unsigned long max_spray_time; // holds the max spray time per zone in seconds
unsigned long spray_timeoff[(number_of_thermostats+1)]; //array holdings since board booted
int rain_sensor_reading[(number_of_thermostats+1)]; // saves valry, 0=soaked)
int rain_threshold; // globder one per zone
int temp_buffer; // gln
int temp_threshold_zone[(number_of_thermostats+1)];
int rain_threshold_zone[(number_of_thermostats+1)];
int relay_activated_count[(number_of_thermostats+1)]; // number oswitched on
int temperature_fluctuation = 7; // we do not wanso it must be a bad read.
int previous_temperature_reading[(number_of_thermostats+1)]; // stores theno previous reading to compare
bool first_temp_reading[(number_of_thermostats+1)]; // flag to indic
bool business_hours = true; // must be t
int temperature_out_of_range_counter[(number_of_thermostats+1)];
long check_end_of_day_delay = 1000*60*10; // every 10 mins
bool end_of_day_email_sent = false;
// ==================================================================
// Setup Blynk Widgets and associate them to approproate Virtual Pins
// Time and Date Display
#define vPIN_timedatestamp 0
// RTC = V20
#define vPIN_rtc 20
// *******NOTE: V100 used by Wemos for RTC
// terminal = V8 used for information printout
#define vPIN_terminal 8
// temrinal = V85 for WARNING and ERROR messages that are cyclic in nature
#define vPIN_terminal_warning 85
// AutoMode Button = V19
#define vPIN_AutoMode 19
// flow meter real time display = v40
#define vPIN_flowmeter 40
#define vPIN_totalwaterused 42
// flow meter led = v41
#define vPIN_flowmeter_led 41
#define vPIN_system_heartbeat_led 86
bool system_heartbeat_led_flag; // flag used to toggle system heartbeat led
// lcd1 for showing realtime flow rate = v50
int syncPins[] = { V1, V2, V3, V4, V8, V9, V10, V11, V12, V13, V19, V20, V30, V31, V40, V41, V42, V50, V70, V71, V72, V73, V74, V75, V76, V77, V78, V79, V80, V81, V82, V83, V84, V85};
// *******NOTE: V100 used by Wemos for RTC
// ==================================================================
WidgetLCD lcd1(V50); //middle lcd widget in blynk app on virtual pin 1
WidgetRTC rtc; // create a RTC Blynk Widget
BLYNK_ATTACH_WIDGET(rtc, vPIN_rtc); // attache RTC Blynk Widget to V20
WidgetTerminal terminal(vPIN_terminal); // Attach virtual serial terminal to Virtual Pin V8
WidgetTerminal terminal_warning(vPIN_terminal_warning); // Attach virtual serial terminal to Virtual Pin V85
WidgetLED water_flowing_led(vPIN_flowmeter_led); // need to re-associate these
WidgetLED system_heartbeat_led (vPIN_system_heartbeat_led); // need to re-associate these
// WidgetLED led_garage(V1);
// WidgetLED led_gate2(V3);
#ifdef THERMOSTAT_ONEWIRE_CODE
// Setup a oneWire instance to communicate with any OneWire devices (not just Maxim/Dallas temperature ICs)
OneWire oneWire(ONE_WIRE_BUS);
// Pass our oneWire reference to Dallas Temperature.
DallasTemperature sensors(&oneWire);
int numberOfDevices; // Number of temperature devices found
DeviceAddress tempDeviceAddress; // We'll use this variable to store a found device address
#endif
// Time to sleep (in seconds):
const int sleepTimeS = (10);
bool V1_written = 0;
char auth[] = "082333de19c"; // smart coo
//============================================
//===== SETUP() =========
//===========================================-
void setup()
{
int x; // counter for FOR loop
// pinMode (ONE_WIRE_BUS, INPUT_PULLUP); // set GPIOxx Onewire with Internal PULL_UP resistor on for it to work
pinMode (RELAY1, OUTPUT);
pinMode (RELAY2, OUTPUT);
pinMode (RELAY3, OUTPUT);
pinMode (RELAY4, OUTPUT);
// pinMode(alertPin, OUTPUT); // not using this at the moment
pinMode(rainSensePin_1, INPUT); // setup analgue pins on Mega for rainsensors
pinMode(rainSensePin_2, INPUT);
Serial.begin(BaudRate);
relay_activated_count[1] = 0;
relay_activated_count[2] = 0;
relay_activated_count[3] = 0;
relay_activated_count[4] = 0;
for (x = 1; x <= (number_of_thermostats+1); x++) {
previous_temperature_reading[x] = -200;
first_temp_reading[x] = false; // flag to indicate this is our first temp reading
temperature_out_of_range_counter[x] = 0;
} // end for
#ifdef THERMOSTAT_ONEWIRE_CODE
if(oneWire.reset()==1) { Serial.println ("OneWire has been reset correctly");}
else { Serial.println ("One wire reset was UNSUCCESSFUL!");}
Serial.println("Dallas Temperature IC Control Library Demo");
// Start up the library
sensors.begin();
sensors.setResolution(Thermo_1,12);
sensors.setResolution(Thermo_2,12);
sensors.setResolution(Thermo_3,12);
sensors.setResolution(Thermo_0, 12);
// sensors.setResolution(Thermo_4,12);
// sensors.setResolution(Thermo_5,12);
// sensors.setResolution(Thermo_Ambient, 12); // Ambient Temperature Thermostat
// Grab a count of devices on the wire
numberOfDevices = sensors.getDeviceCount();
// locate devices on the bus
Serial.print("Locating devices...");
Serial.print("Found ");
Serial.print(numberOfDevices, DEC);
Serial.println(" devices.");
Serial.print("Resolution set to:");
// sensors.setResolution(TEMPERATURE_PRECISION);
Serial.println(sensors.getResolution());
#endif
#ifdef USE_ESP8266
// WiFi.config(arduino_ip, gateway_ip, subnet_mask);
WiFi.begin(ssid, pass); // Connect to WiFi network
Serial.println("Waiting to connect to Wifi:");
while (WiFi.status() != WL_CONNECTED) { // Wait for board to connect to WiFi network
delay(500);
Serial.print(".");
}
Serial.println();
Blynk.config(auth, "xxxxxx"); //
#endif
#ifdef USE_MEGA2560
Blynk.begin(auth, "xxx.com", 8442);
#endif
while (Blynk.connect() == false) { // wait for Blynk to be connected
}
rtc.begin(); // start RTC
#ifdef DISPLAY_DEBUG
Serial.println ("BLYNK is Connected!");
#endif
//====== Stamp Filename and Verison number in terminal so easy to find app source code =====
terminal.print(source_filename);
terminal.println(source_version);
terminal.flush();
// clockcounter = timer.setInterval (300L, gettime); // check if clock has updated every second
#ifdef USE_ESP8266
clockcounter = timer.setInterval (200L, gettime);
#endif
//======= SetUp Code for FlowSensor =========
pinMode(sensorPin, INPUT_PULLUP);
// digitalWrite(sensorPin, HIGH); // SHOULD IT BE HIGH ?
pulseCount = 0;
flowRate = 0.0;
flowMilliLitres = 0;
totalMilliLitres = 0;
oldTime = 0;
totalLitres = 0.0;
// The Hall-effect sensor is connected to pin 2 which uses interrupt 0.
// Configured to trigger on a FALLING state change (transition from HIGH
// state to LOW state)
#ifdef USE_ESP8266
// ===== OTA CODE ======
// Port defaults to 8266
ArduinoOTA.setPort(8266);
// Hostname defaults to esp8266-[ChipID]
ArduinoOTA.setHostname("gate and garage wemo d1 r1");
// No authentication by default
ArduinoOTA.setPassword((const char *)"123");
ArduinoOTA.onStart([]() {
Serial.println("Start");
});
ArduinoOTA.onEnd([]() {
Serial.println("\nEnd");
});
ArduinoOTA.onProgress([](unsigned int progress, unsigned int total) {
Serial.printf("Progress: %u%%\r", (progress / (total / 100)));
});
ArduinoOTA.onError([](ota_error_t error) {
Serial.printf("Error[%u]: ", error);
if (error == OTA_AUTH_ERROR) Serial.println("Auth Failed");
else if (error == OTA_BEGIN_ERROR) Serial.println("Begin Failed");
else if (error == OTA_CONNECT_ERROR) Serial.println("Connect Failed");
else if (error == OTA_RECEIVE_ERROR) Serial.println("Receive Failed");
else if (error == OTA_END_ERROR) Serial.println("End Failed");
});
ArduinoOTA.begin();
#endif
// timer.setInterval(4000L, reconnectBlynk); // check every 4s if still connected to server
// timer.setTimeout(2000L,clockDisplay_to_terminal); // print current date and time to terminal
long check_end_of_day_delay = 1000*60*10; // every 10 mins
#ifdef USE_MEGA2560
wdt_enable(WDTO_8S); // setup Watch Dog timer for 8 seconds -- if Watchdog not resert in that period i.e. wdr_reset() not called, then the board will automatically reset
#ifdef DISPLAY_DEBUG
Serial.println ("Watch Dog timer setup for seconds = ");
Serial.println (WDTO_8S);
#endif
#endif
Blynk.email("ddd@gmail.com", "Setup : d d", "ddddddon"); // send email noting we starting up for first time
// Blynk.SetProperty(vPIN_flowmeter_led, "color", BLYNK_GREEN); // set color to green for flow meter (note: red indicates an issue)
}
//====== end setup =======
//===== Heartbeat =====
void system_heartbeat () {
if (system_heartbeat_led_flag == false) {
system_heartbeat_led.on();
system_heartbeat_led_flag = true;
}
else {
system_heartbeat_led.off();
system_heartbeat_led_flag = false;
}
}
int tempclock_next_function_to_call = 0; // default start point for switch case statement for calling printTemperature, used to track which printTemperature function to call next in tempclock() function
// int next_function_to_call = 0; //
//**************************************
//============= SLEEP CODE =============
void gotosleep() {
// deepSleep time is defined in microseconds. Multiply
// seconds by 1e6
#ifdef DISPLAY_DEBUG
Serial.println ("I'm going to sleep");
#endif
//if (clock_sync == 0) { gettime();}
// ESP.deepSleep(sleepTimeS * 1000000); // go to deepsleep
}
//****************************************************************
//====== RUN THIS CODE ONCE WHEN BLYNK IS FIRST CONNECTED ========
BLYNK_CONNECTED() {
if (isFirstConnect) {
// Blynk.syncAll(); // not doing much for now
isFirstConnect = false;
// Sync pins with a little delay
for(int i=0;i<sizeof(syncPins)/sizeof(int);i++)
{
#ifdef DISPLAY_DEBUG
// displayMessage("Syncing: " + String(syncPins[i]), "");
#endif
Blynk.syncVirtual(syncPins[i]);
delay(5);
}
#ifdef DISPLAY_DEBUG
Serial.println ("Blynk First connected EXECUTED");
#endif
terminal.println ("==== NEW SESSION ====");
terminal.print ("Connected to Blynk Server: ");
clockDisplay_to_terminal();
}
}
// Digital clock display of the time in Blynk App
//***************************************
//===== clockDisplay FUNCTION ==========
void clockDisplay()
{
char TimeandDate[32];
// You can call hour(), minute(), ... at any time
// Please see Time library examples for details
sprintf(Date, "%02d/%02d/%04d", day(), month(), year());
sprintf(Time, "%02d:%02d:%02d", hour(), minute(), second());
sprintf(TimeandDate,"%s %s", Time, Date);
Blynk.virtualWrite(vPIN_timedatestamp,TimeandDate);
#ifdef DISPLAY_DEBUG
Serial.print("Current time: ");
Serial.print(Time);
Serial.print(" ");
Serial.print(Date);
Serial.println();
#endif
// Send time to the App
//Blynk.virtualWrite(V2, Time);
// Send date to the App
// Blynk.virtualWrite(V3, Date);
// if (clock_sync == 1) {
// gotosleep(); }
}
#ifdef USE_ESP8266
//****************************************************
//===== gettime FUNCTION for ESP8266 Boards ==========
void gettime(){
#ifdef DISPLAY_DEBUG
Serial.print ("Year in gettime = ");
Serial.println (year());
#endif
if(year() != 1970){ // we have got the right time now so kill the SimpleTimer
setSyncInterval(300); // normal 5 minute sync interval but not sure this actually works
timer.deleteTimer(clockcounter);
#ifdef DISPLAY_DEBUG
sprintf(Date, "%02d/%02d/%04d", day(), month(), year());
Serial.println(Date);
sprintf(Time, "%02d:%02d:%02d", hour(), minute(), second());
Serial.println(Time);
#endif
terminal.print("Sync Complete: ");
clockDisplay_to_terminal();
clock_sync = 1; // set clock_sync flag to TRUE so we don't call gettime function again from void loop ()
// timer.setInterval(5000L,gotosleep); // in 5 seconds go to sleep
// gotosleep();
}
else {
#ifdef DISPLAY_DEBUG
Serial.println ("still trying to sync :-(");
#endif
rtc.begin(); // keep trying to sync the time until year is not 1970
}
}
#endif
#ifdef USE_MEGA2560
//****************************************************
//===== gettime FUNCTION for ARDUINO Boards ==========
void gettime(){
#ifdef DISPLAY_DEBUG
Serial.print ("Year in gettime = ");
Serial.println (year());
#endif
// DateTime now = RTC.now(); // reads time at beginning of loop
}
#endif
//======= When This Function Called: Display Time and Date to terminal ========
void clockDisplay_to_terminal()
{
// You can call hour(), minute(), ... at any time
// Please see Time library examples for details
sprintf(Date, "%02d/%02d/%04d", day(), month(), year());
sprintf(Time, "%02d:%02d:%02d", hour(), minute(), second());
terminal.print(Time);
terminal.print(" ");
terminal.print(Date);
terminal.println();
terminal.flush();
}
void clockDisplay_to_warning_terminal()
{
// You can call hour(), minute(), ... at any time
// Please see Time library examples for details
sprintf(Date, "%02d/%02d/%04d", day(), month(), year());
sprintf(Time, "%02d:%02d:%02d", hour(), minute(), second());
terminal_warning.print(Time);
terminal_warning.print(" ");
terminal_warning.print(Date);
terminal_warning.println();
terminal_warning.flush();
}
// Total cylce times for each relay
//========== MAIN LOOP =============
void loop()
{
/* if(Blynk.connected() == true){
// Serial.println("Blynk Connect == TRUE");
Blynk.run();
} */
Blynk.run();
timer.run();
#ifdef USE_ESP8266
ArduinoOTA.handle();
#endif
#ifdef USE_MEGA2560
wdt_reset(); // make sure this is called less than WDTO_8S
#endif
}
Console output:
Build options changed, rebuilding all
In file included from E:\OneDrive\OneDrive\My Arduino Code Library 22Oct2016\Arduino\Test_code_1\Test_code_1.ino:145:0:
C:\Users\mda\Documents\Arduino\libraries\Blynk\src/WidgetRTC.h:28:12: error: 'time_t' does not name a type
static time_t requestTimeSync();
^
In file included from E:\OneDrive\OneDrive\My Arduino Code Library 22Oct2016\Arduino\Test_code_1\Test_code_1.ino:145:0:
C:\Users\mda\Documents\Arduino\libraries\Blynk\src/WidgetRTC.h:34:35: error: no 'time_t WidgetRTC::requestTimeSync()' member function declared in class 'WidgetRTC'
time_t WidgetRTC::requestTimeSync()
^
C:\Users\mda\Documents\Arduino\libraries\Blynk\src/WidgetRTC.h: In member function 'void WidgetRTC::begin()':
C:\Users\mda\Documents\Arduino\libraries\Blynk\src/WidgetRTC.h:45:21: error: 'requestTimeSync' was not declared in this scope
setSyncProvider(requestTimeSync);
^
exit status 1
Error compiling for board Arduino/Genuino Mega or Mega 2560.