I am trying to get the following code to compile. But I keep getting the error below
Trying to use the code below with Blynk But not able to get it to compile.
I do see that the slashes “/” are different in the path in the first line below. Is that normal.
Any suggestions are appreciated
c:/users/tim/appdata/local/arduino15/packages/esp32/tools/riscv32-esp-elf-gcc/esp-2021r2-patch5-8.4.0/bin/…/lib/gcc/riscv32-esp-elf/8.4.0/…/…/…/…/riscv32-esp-elf/bin/ld.exe: C:\Users\Tim\AppData\Local\Temp\arduino\sketches\FF072F56755E7D4A166D6BE18A3495F0\libraries\Blynk\utility\BlynkHandlers.cpp.o: in function BlynkWidgetWrite': c:\Users\Tim\Documents\Arduino\libraries\Blynk\src\utility/BlynkHandlers.cpp:25: multiple definition of
BlynkWidgetWrite’; C:\Users\Tim\AppData\Local\Temp\arduino\sketches\FF072F56755E7D4A166D6BE18A3495F0\sketch\ESP32_Test_3.ino.cpp.o:C:\Users\Tim\Documents\Arduino\ESP32_Test_3/ESP32_Test_3.ino:15: first defined here
collect2.exe: error: ld returned 1 exit status
Using library WiFi at version 2.0.0 in folder: C:\Users\Tim\AppData\Local\Arduino15\packages\esp32\hardware\esp32\2.0.9\libraries\WiFi
Using library Blynk at version 1.2.0 in folder: C:\Users\Tim\Documents\Arduino\libraries\Blynk
exit status 1
Compilation error: exit status 1
//#include <dummy.h>
#define BLYNK_PRINT Serial
#include <WiFi.h>
#include <WiFiClient.h>
#include <BlynkSimpleEsp32.h>
#define BLYNK_TEMPLATE_ID "TMPL2KeS9F_EJ"
#define BLYNK_TEMPLATE_NAME "Vibration"
#define BLYNK_AUTH_TOKEN "vEjrn2pptbbQch563iuzuIkH0STIES8S"
char auth[] = BLYNK_AUTH_TOKEN;
char ssid[] = "mynetwork";
char pass[] = "mypassword";
BLYNK_WRITE() {
digitalWrite(V2, OUTPUT);
Blynk.begin(auth, ssid, pass, "blynk.cloud", 80);
}
int Vibration_signal = 9;
int Sensor_State = 1;
void setup() {
pinMode(Vibration_signal,INPUT);
Serial.begin(9600);
}
void loop() {
Serial.print("Machine Status: ");
Sensor_State = digitalRead(Vibration_signal);
if (Sensor_State ==1){
Serial.println("Running");
}
else {
Serial.println("Stopped");
}
delay(200);
}