   Serial.println();
   Serial.print("connected: ");
   Serial.println(WiFi.localIP());
-  
+
   Firebase.begin("example.firebaseio.com", "secret_or_token");
 }
 

#include <ESP8266WiFi.h>
#include <FirebaseArduino.h>

void setup() {
  Serial.begin(9600);

  // power grove connector
  pinMode(15, OUTPUT);
  digitalWrite(15, HIGH);

  // pin 5 is connected to a vibrator motor.
  pinMode(5, OUTPUT);
  // pin A0 is connected to a light sensor.
  pinMode(A0, INPUT);
  // pin 12 is connected to a red LED.
  pinMode(12, OUTPUT);
  // pin 14 is connected to a push button.
  pinMode(14, INPUT);
  // pin 13 is connected to a fan.
  pinMode(13, OUTPUT);

  // connect to wifi.
  WiFi.begin("SSID", "PASSWORD");

float light = 0.0;

void loop() {
  digitalWrite(pin_led, (int)Firebase.get("redlight"));
  digitalWrite(pin_fan, (int)Firebase.get("cooldown"));
  digitalWrite(pin_vibrator, (int)Firebase.get("brrr"));
  int newButton = digitalRead(pin_button);
  if (newButton != button) {
    button = newButton;
    Firebase.set("pushbutton", button);
  }
  float newLight = analogRead(pin_light_sensor);
  if (abs(newLight - light) > 100) {
    light = newLight;
    Firebase.set("sunlight", light);
