I am new to Blynk. I know how to turn on outputs but now I simply want to illuminate an LED widget with an input on my Node MCU ESP8266. The real world input is tied to GPIO 4 on my Node MCU. Here is the code I am trying:
/* ********************************************************************************************
Home in the Hills 2
*/
#include <ESP8266WiFi.h>
#include <BlynkSimpleEsp8266.h>
#include <Wire.h>
WidgetLED led1(V6);
char auth[] = “auth”;
void setup()
{
pinMode(0, INPUT); // IOT Input
Serial.begin(115200);
Blynk.begin(auth, “SSID”, “PASSWORD”);
}
// =================={ Virtual LED Input Monitoring }=========
void checkPin()
{
if (digitalRead(0) == LOW) // GPIO4
{
led1.off();
} else {
led1.on();
//Blynk.email("myname@yahoo.com", “INPUT IS ON”);
}
}
// ==============( Void Loop ) ====================================
void loop()
{
checkPin();
Blynk.run();
yield();
}