Best IOT Project By Technical idEas
📌 What's app :- https://chat.whatsapp.com/I4Nv0YEt1hK3Z9EVjsvngh
Download Blink Library
BLINK LIBRARY add Video :- https://youtu.be/gNX2lOuA1Jo
👨🏻💻 Code :-
| /* | |
| code started | |
| created by Technical idEas (YT) | |
| chennal link :- https://youtube.com/c/TechnicalidEas07 | |
| #define light = 1; | |
| #define sensor = A0; | |
|
| |
| */ | |
#define BLYNK_PRINT Serial | ||
#include <ESP8266WiFi.h> | ||
#include <BlynkSimpleEsp8266.h> | ||
#define led D1 | ||
#define sensor A0 | ||
char auth[] = "aF2T__AGsARwYsWAfXyfRiAdbTkc_jUz"; | ||
char ssid[] = "Samrat"; | ||
char pass[] = "00000000"; | ||
BlynkTimer timer; | ||
void setup() | ||
{ | ||
// Debug console | ||
pinMode(led, OUTPUT); | ||
Serial.begin(9600); | ||
Blynk.begin(auth, ssid, pass); | ||
timer.setInterval(500L, sendSensor); | ||
} | ||
void loop() | ||
{ | ||
Blynk.run(); | ||
timer.run(); | ||
} | ||
void sendSensor() | ||
{ | ||
int LDR = analogRead(sensor); | ||
if(LDR <150) | ||
{ | ||
digitalWrite(led, LOW); | ||
} | ||
else | ||
{ | ||
digitalWrite(led, HIGH); | ||
Blynk.notify("Hay Technical idEas is Light ON"); | ||
} | ||
Blynk.virtualWrite(V5, LDR); | ||
} |
Comments
Post a Comment