hi guys, so i have this code
#define BLYNK_PRINT Serial
#include <SPI.h>
#include <ESP8266WiFi.h>
#include <SimpleTimer.h>
#define AOUT_PIN A0 // The ESP8266 pin ADC0 that connects to AOUT pin of moisture sensor
int pump = 0; // Pin 0 pada NodeMCU (pin 3)
#define BLYNK_TEMPLATE_ID "T
#define BLYNK_TEMPLATE_NAME ""
#define BLYNK_AUTH_TOKEN ""
char auth[] = "; // Enter your Auth token
char ssid[] = ""; // Enter your WIFI name
char pass[] = ""; // Enter your WIFI password (HOTSPOT PASSWORD)
#include <BlynkSimpleEsp8266.h>
SimpleTimer timer;
WidgetLCD lcd(V1);
void setup() {
Serial.begin(9600);
pinMode(pump, OUTPUT);
lcd.clear();
Blynk.begin(auth, ssid, pass);
timer.setInterval(1000L, bacasensor);
}
void bacasensor() {
int value = analogRead(AOUT_PIN); // read the analog value from sensor
int persenSensor = 0;
persenSensor = ((1024 - value) / 10.23); // Calculate moisture level in percentage
Serial.print("Moisture: ");
Serial.println(persenSensor);
lcd.print(0, 0, "KEADAAN");
lcd.print(0, 1, "PUMP");
Blynk.virtualWrite(V0, persenSensor);
if (persenSensor == 0) {
Serial.println("KERING");
lcd.print(8, 0, "KERING");
lcd.print(5, 1, "ON ");
digitalWrite(pump, LOW); // Turn off the pump
for (int x = 0; x <= 10; x++) {
lcd.print(9, 1, x);
delay(500);
}
lcd.clear();
digitalWrite(pump, HIGH); // Turn on the pump
lcd.print(0, 0, "AIR MERESAP");
lcd.print(0, 1, "WAIT");
for (int x = 9; x > 0; x--) {
lcd.print(9, 1, x);
delay(500);
}
lcd.clear();
} else if (persenSensor > 40 && persenSensor < 50) {
Serial.println("NORMAL");
lcd.print(8, 0, "NORMAL");
lcd.print(5, 1, "OFF");
digitalWrite(pump, HIGH); // Keep the pump off if the soil is normal
} else if (persenSensor < 40) {
Serial.println("BASAH");
lcd.print(8, 0, "BASAH");
lcd.print(5, 1, "OFF");
digitalWrite(pump, HIGH); // Keep the pump off if the soil is wet
}
}
void loop() {
bacasensor();
Blynk.run();
timer.run();
delay(100);
}
before i try it on blink, i want to try the message and the soil sensor first, theres no such an error but when i open my serial monitor theres no message at all.... am i doing it wrong?