Hi Blynkers, who knows a thing or 2 about Blynk + IR TV codes. My aim is to blynk the samsung code to switch tv on.
Because the same code is for on and off being the power button, i need to send just one pulse. The good news is
that the below code works and indeed powers on the TV with an IR Led connected via a NODEMCU V3 board.
Unfortuanately things go downhill from now on, i have zero control with the Blynk app but i learned that by pressing the RESET
button on the NODEMCU it pulsed again which powered the TV off, as you can gather this is hardly a workable solution.
In light of the below actually working, can someone please add and correct my code so i can Blynk the code on and off using
virtual pins in the blynk app, i have read almost everything on ir control with ESP8266 and could only find one snippet on blynk which did not work for me.
/*
* IRremoteESP8266: IRsendGCDemo - demonstrates sending Global Cache-formatted IR codes with IRsend
* An IR LED must be connected to ESP8266 pin 0.
* Version 0.1 30 March, 2016
* Based on Ken Shirriff's IrsendDemo Version 0.1 July, 2009, Copyright 2009 Ken Shirriff, http://arcfn.com
*/
#include <ESP8266WiFi.h>
#include <BlynkSimpleEsp8266.h>
#include <IRremoteESP8266.h>
// You should get Auth Token in the Blynk App.
// Go to the Project Settings (nut icon).
char auth[] = "********************************";
// Your WiFi credentials.
// Set password to "" for open networks.
char ssid[] = "**********";
char pass[] = "**********";
char server[] = "************";
// Codes are in Global Cache format less the emitter ID and request ID. These codes can be found in GC's Control Tower database.
unsigned int Samsung_power_toggle[71] = {38000,1,1,170,170,20,63,20,63,20,63,20,20,20,20,20,20,20,20,20,20,20,63,20,63,20,63,20,20,20,20,20,20,20,20,20,20,20,20,20,63,20,20,20,20,20,20,20,20,20,20,20,20,20,63,20,20,20,63,20,63,20,63,20,63,20,63,20,63,20,1798};
IRsend irsend(4); //an IR emitter led is connected to GPIO pin 4 (D2)
void setup()
{
irsend.begin();
irsend.sendGC(Samsung_power_toggle, 71);
Serial.begin(115200, SERIAL_8N1, SERIAL_TX_ONLY);
Blynk.begin(auth, ssid, pass, server);
}
void loop() {
Blynk.run();
}