LED in blynk to react HIGH / LOW on photon:s pin

Hello!
I want to make a garage door controller with feedback whether the doors are open or closed. I have tried to understand led.ino programs etc with no luck. What is wrong with my code? I get the relays to work FB, but feedback from micro switches does not work in Blynk. In the code there is the reading of the switches commented and bigState manually set to HIGH due to the test environment without the actual switches.

I know that there is other garage door controller projects with blynk which are fancier. The thing is that I just don’t understand where I go wrong…

Thanks
Jyri

//
// Garage door controller, using BLYNK and Particle photon
// *******************************************************
// Inputs if doors are open or not... ...micro switches
// Small door D1 => info about state to led widget on V1
// Big door D2 => info about state to led widget on V2
//
// relays are connected as following:
// Lights D5 (switch button widget)
// Small door D6 (push button widget)
// Big door D7 (push button widget)
//
// ********************************************************
// This #include statement was automatically added by the Particle IDE.
#include "blynk/blynk.h"

char auth[] = "xxxxxx";


WidgetLED led1(1); // widget for small door
WidgetLED led2(2); // widget for big door
int smallState = LOW; // small doors switch state
int bigState = HIGH; // big doors switch state 

void setup() 
{
  Serial.begin(9600);
  Blynk.begin(auth);
//  while (Blynk.connect() == false) { }     // Wait until connected
  pinMode(D1, INPUT); //is the small door open?
  pinMode(D2, INPUT); //is the big door open?
  pinMode(D5, OUTPUT); //relay for lights
  pinMode(D6, OUTPUT); //relay for small door
  pinMode(D7, OUTPUT); //relay for big door
}



void loop()
{
    Blynk.run();
    checkDoors();
}

void checkDoors()
{
//smallState = D1;
//bigState = D2;
  if (smallState == LOW) {
    led1.on();
  } else {
    led1.off();
  }
  if (bigState == LOW) {
    led2.off();
  } else {
    led2.on();
  }
}

Hi, we made a bunch of examples to show how Blynk API should be used. See LED example here. Your code is incorrect. It causes Flood error.