Created
June 2, 2020 13:31
-
-
Save EDISON-SCIENCE-CORNER/1cb4c23208e5361cb2a1f1d08e3f796e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//www.edisonsciencecorner.blogspot.com | |
//https://www.youtube.com/channel/UCESZHuYTzx0Eyd3yJ8u60Fg | |
#define BLYNK_PRINT Serial | |
#include <ESP8266WiFi.h> | |
#include <BlynkSimpleEsp8266.h> | |
char auth[] = "iyP86B47FRFZlAt_XvVdG8EeYewSh34k"; // blynk token | |
char ssid[] = "edison science corner"; //ssid//password | |
char pass[] = "eeeeeeee"; //password | |
int moisture; | |
int data; | |
void setup() { | |
Serial.begin(9600); | |
pinMode(A0,INPUT); | |
Blynk.begin(auth, ssid, pass); | |
} | |
void loop() | |
{ | |
Blynk.run(); | |
moisture = analogRead(0); //Read Analog value of first sensor | |
delay(100); | |
data = map(moisture,500,1023,100,0); | |
Serial.print("moisture = "); //to the serial monitor | |
Serial.print(data ); | |
Blynk.virtualWrite(V5, data ); // to Blynk server | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment