// // Copyright 2015 Google Inc. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // // FirebaseDemo_ESP8266 is a sample that demo the different functions // of the FirebaseArduino API. #include #include // Set these to run example. #define FIREBASE_HOST "notemtest-77bc9-default-rtdb.firebaseio.com" #define FIREBASE_AUTH "OTRHy29xuD4Kff2sE4LTWZXGGiKngkrtwFPx5W5V" #define WIFI_SSID "TT_B8D8" #define WIFI_PASSWORD "milas123495" int ff =0; void setup() { Serial.begin(9600); // connect to wifi. WiFi.begin(WIFI_SSID, WIFI_PASSWORD); Serial.print("connecting"); while (WiFi.status() != WL_CONNECTED) { Serial.print("."); delay(5000); } Serial.println(); Serial.print("connected: "); Serial.println(WiFi.localIP()); Firebase.begin(FIREBASE_HOST, FIREBASE_AUTH); } int n = 0; void loop() { // set value Firebase.setFloat("3adad", (millis()/1000)); // handle error Firebase.setFloat("testN1", ((millis()/1000)*5)); Firebase.setFloat("testN2", ((millis()/1000)*3)); Firebase.setFloat("testN3", ((millis()/1000)*6)); Firebase.setFloat("testN4", ((millis()/1000)*2)); Firebase.setFloat("testN5", ((millis()/1000)*22)); Firebase.setFloat("testN6", ((millis()/1000)*32)); Firebase.setFloat("testN7", ((millis()/1000)*41)); Firebase.setFloat("testN8", ((millis()/1000)*52)); Firebase.setFloat("testN9", ((millis()/1000)*62)); Firebase.setFloat("testN10", ((millis()/1000)*78)); Firebase.setFloat("testN11", ((millis()/1000)*83)); // handle error delay(100); //ff = ((Firebase.getFloat("3adad")));; // delay(500); // Firebase.setFloat("ra9m",ff+ (millis()/1000) ); //delay(500); // get value //Serial.print("number: "); //Serial.println(Firebase.getFloat("3adad")); // delay(300); // remove value //Firebase.remove("3adad"); // delay(1000); // set string value //Firebase.setString("7ourouf", "aslema"); // handle error // set bool value //Firebase.setBool("truth", false); // handle error //if (Firebase.failed()) { // Serial.print("setting /truth failed:"); // Serial.println(Firebase.error()); // return; //} //delay(300); // append a new value to /logs // String name = Firebase.pushInt("logs", n++); // handle error // if (Firebase.failed()) { // Serial.print("pushing /logs failed:"); // Serial.println(Firebase.error()); // return; // } // Serial.print("pushed: /logs/"); //Serial.println(name); //delay(300); }