I try to do simple coding, receive data from sensor and send to blynk app. When I do without connection of blynk, the serial monitor show range of result from 500-600. As I connect with blynk, 0 value remains. Can you help why?
#define BLYNK_TEMPLATE_ID "TMPLUbWIVa-J"
#define BLYNK_DEVICE_NAME "IoT Sound Monitoring"
#define BLYNK_AUTH_TOKEN "X1M4kjMcKWngRCBVHyaWFZecNuVt47cY"
#include <WiFi.h>
#include <WiFiClient.h>
#include <BlynkSimpleEsp32.h>
char auth[] = BLYNK_AUTH_TOKEN;
char ssid[] = "akmalijat0_2.4GHz@unifi";
char pass[] = "Hyperjackie12#";
const byte soundpin=4;
BlynkTimer timer;
void setup() {
pinMode (soundpin,INPUT);
Serial.begin (115200);
Blynk.begin(auth, ssid, pass);
timer.setInterval(1000L,sensorDataSend);
}
void sensorDataSend(){
int sample= analogRead(soundpin);
Serial.print(sample);
Serial.print("\n");
Blynk.virtualWrite(V0,sample);
}
void loop() {
Blynk.run();
timer.run();
}
0
0
0
0
0
0
0