update ino file

parent e22b4df1
......@@ -6,6 +6,7 @@
const int ledPin1 = 32;
const int ledPin2 = 33;
const int ledPin3 = 15;
#define FIREBASE_HOST "https://esp32ndvi-default-rtdb.asia-southeast1.firebasedatabase.app/"
#define FIREBASE_AUTH "HKm15Lmcvp6NKLOwzioO3AXpa4lANrrpbalX7dl9"
......@@ -33,6 +34,13 @@ void configureSensor(void)
void loop(){
if(WiFi.status() == WL_CONNECTED){
digitalWrite (ledPin3, HIGH);
}else{
digitalWrite (ledPin3, LOW);
}
digitalWrite (ledPin1, HIGH);
digitalWrite (ledPin2, HIGH);
......@@ -58,7 +66,7 @@ delay(ms);
json.set("/ndvi", NDVI);
json.set("/nir", nir);
json.set("/vis", vis);
Firebase.updateNode(firebaseData,"/Sensor",json);
Firebase.updateNode(firebaseData,"/Sensor/dev1",json);
}
......@@ -67,6 +75,7 @@ void setup()
{
pinMode (ledPin1, OUTPUT);
pinMode (ledPin2, OUTPUT);
pinMode (ledPin3, OUTPUT);
configureSensor();
Serial.begin(9600);
Wire.begin();
......@@ -80,6 +89,7 @@ void setup()
Serial.print(".");
}
// Print local IP address and start web server
Serial.println("");
Serial.println("WiFi connected.");
Serial.println("IP address: ");
......@@ -94,4 +104,4 @@ void setup()
Serial.println("------------------------------------");
Serial.println("Connected...");
}
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment