Olá pessoal, estou tentando implantar um sensor IR para controlar uma fita de led. Estou usando um código integrado com o blynk, o código funciona, porém ao tentar enviar algum sinal pelo IR simplesmente trava e acende a luz TX no arduino. Conseguem me ajudar?
O código que estou tentando usar é esse:
#define BLYNK_PRINT Serial
#include <ESP8266_Lib.h>
#include <BlynkSimpleShieldEsp8266.h>
#include <IRremote.h>
// You should get Auth Token in the Blynk App.
// Go to the Project Settings (nut icon).
char auth[] = "auth token";
// Your WiFi credentials.
// Set password to "" for open networks.
char ssid[] = "SSID";
char pass[] = "password";
// or Software Serial on Uno, Nano...
#include <SoftwareSerial.h>
SoftwareSerial EspSerial(2, 3); // RX, TX
// Your ESP8266 baud rate:
#define ESP8266_BAUD 19200
ESP8266 wifi(&EspSerial);
IRsend irsend;
void setup()
{
// Debug console
Serial.begin(9600);
delay(10);
// Set pinMode
pinMode(8, OUTPUT);
// Set ESP8266 baud rate
EspSerial.begin(ESP8266_BAUD);
delay(10);
Blynk.begin(auth, wifi, ssid, pass);
}
BLYNK_WRITE(V1){
if (param.asInt() == 1){
Serial.println("botão DOWN");
irsend.sendNEC(0xF7C03F, 32);
}
else{
Serial.println("botão UP");
}
}
void loop()
{
Blynk.run();
}