Wemos D1 R2 virtual pins

Hi! I’m new to arduino i was using this sketch below with arduino uno with blynk app to monitor a magnetic switch on off status. After i purchase the wemos d1 r2 esp8266 to go wireless i try to upload the same sketch to the wemos d1 r2 but virtual pins are not working.
Can anyone please help me with that . Thank you: Constantinos

#define BLYNK_PRINT Serial    // Comment this out to disable prints and save space
#include <ESP8266WiFi.h>
#include <BlynkSimpleEsp8266.h>

char auth[] = "xxxxxxxxxxxxxxxxxxxx";
WidgetLED led1(V1);
WidgetLED led2(V2);

void setup()
{
   Blynk.begin(auth, "1fcab4", "278864212");
  // Default baud rate is 9600. You could specify it like this:
  //Blynk.begin(auth, 57600);
   pinMode(2, INPUT);
   pinMode(3, INPUT);
   // Attach INT to our handler
  attachInterrupt(digitalPinToInterrupt(2), checkPin, CHANGE);

  attachInterrupt(digitalPinToInterrupt(3), checkPin, CHANGE);

}

void checkPin()
{
  
  if (digitalRead(2)) {    
  if (digitalRead(3))
      led1.off();
      led2.on();
  } else {
      led1.on();
      led2.off();
  }
}


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

With the pins being different on the WeMos than the Uno, I would start there. Throw a few serial lines (like below), push the buttons and see if the serial monitor is showing those button pushes:

void checkPin()
{
  
  if (digitalRead(2)) {    
  if (digitalRead(3))
      led1.off();
      led2.on();
      Serial.println("LED ON");
  } else {
      led1.on();
      led2.off();
      Serial.println("LED OFF");

  }
}

If you have your buttons on WeMos pins D2 and D3, you’d want your code to be pinMode(4, INPUT); pinMode(0, INPUT); (in lieu of pinMode(2, INPUT); pinMode(3, INPUT);)… and elsewhere in your code.

Thank you for your quick reply but am little confused i try everything you told me .Is it possible to make the changes to the code so i can use it with wemos d1 or send me an example? I know i am asking a lot:-)

Maybe you need to check pin number, wemos pin number diffrence with Arduino.

Oh 'cmon now! Give this a go:

#define BLYNK_PRINT Serial    // Comment this out to disable prints and save space
#include <ESP8266WiFi.h>
#include <BlynkSimpleEsp8266.h>

char auth[] = "xxxxxxxxxxxxxxxxxxxx";
char ssid[] = "1fcab4";
char pass[] = "278864212";

WidgetLED led1(V1);
WidgetLED led2(V2);

void setup()
{
  Blynk.begin(auth, ssid, pass);
  
  Serial.begin(9600);
  
  pinMode(4, INPUT);  // Pin D2 on WeMod D1 R2
  pinMode(0, INPUT);  // Pin D3 on WeMos D1 R2
  
  // Attach INT to our handler
  attachInterrupt(digitalPinToInterrupt(4), checkPin, CHANGE);
  attachInterrupt(digitalPinToInterrupt(0), checkPin, CHANGE);

}

void checkPin()
{
  if (digitalRead(4)) {
    Serial.println("Button #1 pressed");
    if (digitalRead(0))
      Serial.println("Button #2 pressed");
      led1.off();
    led2.on();
    Serial.println("LED2 on");
  } else {
    led1.on();
    led2.off();
  }
}

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

Also, I don’t know what you’re hardware/physical connections look like. There maybe an issue there.