#include <WiFi.h>
#include <WiFiClient.h>
#include <DHT.h>
#define BLYNK_PRINT Serial
#define BLYNK_TEMPLATE_ID "TMPL6BO43grU_"
#define BLYNK_TEMPLATE_NAME "MINI TB ELIND"
#define BLYNK_AUTH_TOKEN "PDc2L-fPkQxrSrb6zkJ2fZQoQYmgluS-"
char ssid[] = "Infinix NOTE 30 Pro";
char pass[] = "87654321";
float humidityValue;
float temperatureValue;
#define Blower_PIN 23
#define Lampu_PIN 25
#define LDR_PIN 34
#define DHTPIN 22
#define DHTTYPE DHT22
DHT dht(DHTPIN, DHTTYPE);
int ldrValue, cahaya;
void setup() {
// put your setup code here, to run once:
Serial.begin(9600);
Serial.println("Hello, ESP32!");
Blynk.begin(BLYNK_AUTH_TOKEN, ssid, pass);
dht.begin();
pinMode(Blower, OUTPUT);
pinMode(Lampu, OUTPUT);
pinMode(LDR, INPUT);
}
void loop() {
// put your main code here, to run repeatedly:
ldrValue = analogRead(LDR_PIN);
cahaya = map(ldrValue, 0, 1023, 0, 100);
}