Virtual LED linked to button - wont light

Wondered if somebody could have a look at my code and tell me where i’m going wrong… I’m trying to get a virtual LED to light when I flick a switch in Blynk, but it just wont Light the virtual LED. I’m only an amatuer programmer so my code is probably a little long winded, for that I apologies! Any help you can give will be much appreciated!! I’ve tried a few different ways looking through passed threads but none of them have worked… Please Help!

#include <arduino.h>
#include "DHT.h"
#include <ESP8266WiFi.h>
#include <BlynkSimpleEsp8266.h>
#include <SimpleTimer.h>
//Globals for DHT sensor

#define DHTPIN  3
#define DHTTYPE DHT22

// You should get Auth Token in the Blynk App.
// Go to the Project Settings (nut icon).
char auth[] = "token here";

// Your WiFi credentials.
// Set password to "" for open networks.
char ssid[] = "ssid";
char pass[] = "password";

//Select your pin with physical button
const int btnPin = 1;

WidgetLED led3(V3);

SimpleTimer timer;

//V3 LED Widget represents the physical button state
boolean btnState = false;
void buttonLedWidget()
  // Read button
  boolean isPressed = (digitalRead(btnPin) == LOW);

  //If State has changed...
  if (isPressed != btnState) {
    if (isPressed) {
    } else {;
    btnState = isPressed;

void sendUptime()
  // You can send any value at any time.
  // Please don't send more that 10 values per second.
  Blynk.virtualWrite(4, millis()/1000);

void sendSensor()
  float h = dht.readHumidity();
  float t = dht.readTemperature(); // or dht.readTemperature(true) for Fahrenheit

  if (isnan(h) || isnan(t)) {
    Serial.println("Failed to read from DHT sensor!");

Blynk.virtualWrite(V5, h);
Blynk.virtualWrite(V6, t);
void setup()
  Blynk.begin(auth, ssid, pass);
  // You can also specify server:
  //Blynk.begin(auth, ssid, pass, "", 8442);
  //Blynk.begin(auth, ssid, pass, IPAddress(192,168,1,100), 8442);
  timer.setInterval(1000, sendUptime);

  // Setup physical button pin (active low)
  pinMode(btnPin, INPUT_PULLUP);

  timer.setInterval(500L, buttonLedWidget);


  // Setup a function to be called every second
  timer.setInterval(1000L, sendSensor);

void loop()
{;; // Initiates SimpleTimer


@Solway ESP’s don’t have a pin 3 and pin 1 is the tx pin. Do you really need to refresh the temp & humidity every second?

@Solway I have found that it is sometimes necessary to preset the virtual LEDs “intensity”:

led3.setValue(255); // Set brightness of vLED to 100%.

This needs only called once, perhaps in setup.

Thanks guys I’ll take a look when I get back from work!