Hi,
I am a complete beginner when it comes to Arduino, NodeMCU and Programming in general. I am trying to learn by doing some basic projects, whilst connecting and visualising via Blynk.
I am currently trying to view the data taken from a rain sensor via the NodeMCU (A0) and display it in Blynk. I have set up my Blynk cloud but have an issue when verifying the current code I have. The error code I received can be seen below along with the code I have created so far. Any help would be much appreciated.
Arduino: 1.8.15 (Windows 10), Board: "NodeMCU 1.0 (ESP-12E Module), 80 MHz, Flash, Disabled (new aborts on oom), Disabled, All SSL ciphers (most compatible), 32KB cache + 32KB IRAM (balanced), Use pgm_read macros for IRAM/PROGMEM, 4MB (FS:2MB OTA:~1019KB), 2, v2 Lower Memory, Disabled, None, Only Sketch, 115200"
Edgent_ESP8266:20:12: error: redefinition of 'BlynkTimer timer'
20 | BlynkTimer timer;
| ^~~~~
In file included from C:\Users\Conor\AppData\Local\Temp\arduino_modified_sketch_386518\Edgent_ESP8266.ino:18:
C:\Users\Conor\AppData\Local\Temp\arduino_modified_sketch_386518\BlynkEdgent.h:113:12: note: 'BlynkTimer timer' previously declared here
113 | BlynkTimer timer;
| ^~~~~
Multiple libraries were found for "BlynkSimpleEsp8266_SSL.h"
Used: C:\Users\Conor\Documents\Arduino\libraries\blynk-library-master
Not used: C:\Users\Conor\Documents\Arduino\libraries\Blynk
exit status 1
redefinition of 'BlynkTimer timer'
This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.
// Fill-in information from your Blynk Template here
#define BLYNK_TEMPLATE_ID "XXXXXXXX"
#define BLYNK_DEVICE_NAME "XXXXXX"
#define BLYNK_FIRMWARE_VERSION "0.1.0"
#define BLYNK_PRINT Serial
//#define BLYNK_DEBUG
#define APP_DEBUG
// Uncomment your board, or configure a custom board in Settings.h
//#define USE_SPARKFUN_BLYNK_BOARD
#define USE_NODE_MCU_BOARD
//#define USE_WITTY_CLOUD_BOARD
#include "BlynkEdgent.h"
BlynkTimer timer;
// This function sends Arduino's up time every second to Virtual Pin (5).
// In the app, Widget's reading frequency should be set to PUSH. This means
// that you define how often to send data to Blynk App.
void myTimerEvent()
{
// You can send any value at any time.
// Please don't send more that 10 values per second.
Blynk.virtualWrite(V5, millis() / 1000);
}
void setup()
{
Serial.begin(115200);
delay(100);
BlynkEdgent.begin();
timer.setInterval(1000L, myTimerEvent);
}
void loop() {
BlynkEdgent.run();
timer.run(); // Initiates BlynkTimer
}