Hi all,
I’m a beginner in Blynk work but I’m very passionate on IOT project.
I’m working on a personal project to manage some led in living room + get some extra stuff like degree.
BACKGROUND:
Chipset: NODE MCU 1.0
IDE: arduino IDE
Library: I’m using this library for IR: <IRremoteESP8266.h>
Cable will be connected to PIN 4
GOAL:
I want create a button in Blynk App. This botton have to send via IR a code to my LED replacing the remote control.
PROBLEM:
I don’t know understand how to set up it correctly.
This is the code (sorry you can find extra stuff to manage the rest of the project.Everythink is commented. I don’t know how to put this
irsend.sendNEC(0xF7C03F,32);
in a button in Blynk.
//SET UP NODEMCU
//SWICHER RELAY --> everythink Virtual --> Output D5 1 -> 0 SWITCH
//DTT22 --> --> data on TX
//
// Blink
#define BLYNK_PRINT Serial // Comment this out to disable prints and save space
#include <ESP8266WiFi.h>
#include <BlynkSimpleEsp8266.h>
#include <SimpleTimer.h>
// IR remote
#include <IRremoteESP8266.h>
// DHT 22
#include <Adafruit_Sensor.h>
#include <DHT.h>
#include <DHT_U.h>
#define DHTPIN 1 //Connesso a TX x sensore DHT22
#define DHTTYPE DHT22
DHT_Unified dht(DHTPIN, DHTTYPE);
char auth[] = "XXXXXXXXXXXXXXXXXXXXXXXXXX";
SimpleTimer timer;
IRsend irsend(4); //an IR emitter led is connected to GPIO pin 4
void setup()
{
Serial.begin(9600);
Blynk.begin(auth, "YYYY", "ZZZZZ");
dht.begin();
// Setup a function to be called every second
timer.setInterval(5000L, sendUptime);
}
void sendUptime()
{
// V1 degrees
Blynk.virtualWrite(V5, millis() / 1000);
sensors_event_t event;
dht.temperature().getEvent(&event);
if (!isnan(event.temperature)) {
Blynk.virtualWrite(V1, event.temperature);
}
// V2 humidity
dht.humidity().getEvent(&event);
if (!isnan(event.relative_humidity)) {
Blynk.virtualWrite(V2, event.relative_humidity);
}
}
void loop()
{
Blynk.run();
timer.run();
//SEND IR
irsend.sendNEC(0xF7C03F,32);
delay(10000);
}
Thank you in advance for supporting me