Hardware components | ||||||
| × | 1 | ||||
| × | 1 | ||||
| × | 1 | ||||
Software apps and online services | ||||||
| ||||||
| ||||||
Hand tools and fabrication machines | ||||||
|
Just you have to create real-time database in Google Firebase.
https://firebase.google.com/docs/database
Just you need:
1. FirebaseURL
2. Firebase Token
Here we are using Tsop 1738, IR transmitter and Wemos D1. You can use another microcontroller but make sure that it have built-in ESP8266.
Decoding Remote
ArduinoThis is first part.
This code is from, Arduino IDE -->File --> examples --> IRremoteesp8266 --> IRrecvDumpV2.
For that must you have IRremoteesp8266 library.
Now just upload this and note decoded IR Data.
This code is from, Arduino IDE -->File --> examples --> IRremoteesp8266 --> IRrecvDumpV2.
For that must you have IRremoteesp8266 library.
Now just upload this and note decoded IR Data.
#ifndef UNIT_TEST
#include <Arduino.h>
#endif
#include <IRrecv.h>
#include <IRremoteESP8266.h>
#include <IRutils.h>
#include <ir_Coolix.h>
#include <ir_Daikin.h>
#include <ir_Fujitsu.h>
#include <ir_Gree.h>
#include <ir_Haier.h>
#include <ir_Hitachi.h>
#include <ir_Kelvinator.h>
#include <ir_Midea.h>
#include <ir_Mitsubishi.h>
#include <ir_MitsubishiHeavy.h>
#include <ir_Panasonic.h>
#include <ir_Samsung.h>
#include <ir_Tcl.h>
#include <ir_Teco.h>
#include <ir_Toshiba.h>
#include <ir_Vestel.h>
#include <ir_Whirlpool.h>
const uint16_t kRecvPin = D6;
const uint32_t kBaudRate = 115200;
const uint16_t kCaptureBufferSize = 1024;
#if DECODE_AC
const uint8_t kTimeout = 50;
#else
const uint8_t kTimeout = 15;
#endif
const uint16_t kMinUnknownSize = 12;
IRrecv irrecv(kRecvPin, kCaptureBufferSize, kTimeout, true);
decode_results results; // Somewhere to store the results
void dumpACInfo(decode_results *results) {
String description = "";
#if DECODE_DAIKIN
if (results->decode_type == DAIKIN) {
IRDaikinESP ac(0);
ac.setRaw(results->state);
description = ac.toString();
}
#endif // DECODE_DAIKIN
#if DECODE_DAIKIN2
if (results->decode_type == DAIKIN2) {
IRDaikin2 ac(0);
ac.setRaw(results->state);
description = ac.toString();
}
#endif // DECODE_DAIKIN2
#if DECODE_DAIKIN216
if (results->decode_type == DAIKIN216) {
IRDaikin216 ac(0);
ac.setRaw(results->state);
description = ac.toString();
}
#endif // DECODE_DAIKIN216
#if DECODE_FUJITSU_AC
if (results->decode_type == FUJITSU_AC) {
IRFujitsuAC ac(0);
ac.setRaw(results->state, results->bits / 8);
description = ac.toString();
}
#endif // DECODE_FUJITSU_AC
#if DECODE_KELVINATOR
if (results->decode_type == KELVINATOR) {
IRKelvinatorAC ac(0);
ac.setRaw(results->state);
description = ac.toString();
}
#endif // DECODE_KELVINATOR
#if DECODE_MITSUBISHI_AC
if (results->decode_type == MITSUBISHI_AC) {
IRMitsubishiAC ac(0);
ac.setRaw(results->state);
description = ac.toString();
}
#endif // DECODE_MITSUBISHI_AC
#if DECODE_MITSUBISHIHEAVY
if (results->decode_type == MITSUBISHI_HEAVY_88) {
IRMitsubishiHeavy88Ac ac(0);
ac.setRaw(results->state);
description = ac.toString();
}
if (results->decode_type == MITSUBISHI_HEAVY_152) {
IRMitsubishiHeavy152Ac ac(0);
ac.setRaw(results->state);
description = ac.toString();
}
#endif // DECODE_MITSUBISHIHEAVY
#if DECODE_TOSHIBA_AC
if (results->decode_type == TOSHIBA_AC) {
IRToshibaAC ac(0);
ac.setRaw(results->state);
description = ac.toString();
}
#endif // DECODE_TOSHIBA_AC
#if DECODE_GREE
if (results->decode_type == GREE) {
IRGreeAC ac(0);
ac.setRaw(results->state);
description = ac.toString();
}
#endif // DECODE_GREE
#if DECODE_MIDEA
if (results->decode_type == MIDEA) {
IRMideaAC ac(0);
ac.setRaw(results->value); // Midea uses value instead of state.
description = ac.toString();
}
#endif // DECODE_MIDEA
#if DECODE_HAIER_AC
if (results->decode_type == HAIER_AC) {
IRHaierAC ac(0);
ac.setRaw(results->state);
description = ac.toString();
}
#endif // DECODE_HAIER_AC
#if DECODE_HAIER_AC_YRW02
if (results->decode_type == HAIER_AC_YRW02) {
IRHaierACYRW02 ac(0);
ac.setRaw(results->state);
description = ac.toString();
}
#endif // DECODE_HAIER_AC_YRW02
#if DECODE_SAMSUNG_AC
if (results->decode_type == SAMSUNG_AC) {
IRSamsungAc ac(0);
ac.setRaw(results->state, results->bits / 8);
description = ac.toString();
}
#endif // DECODE_SAMSUNG_AC
#if DECODE_COOLIX
if (results->decode_type == COOLIX) {
IRCoolixAC ac(0);
ac.setRaw(results->value); // Coolix uses value instead of state.
description = ac.toString();
}
#endif // DECODE_COOLIX
#if DECODE_PANASONIC_AC
if (results->decode_type == PANASONIC_AC &&
results->bits > kPanasonicAcShortBits) {
IRPanasonicAc ac(0);
ac.setRaw(results->state);
description = ac.toString();
}
#endif // DECODE_PANASONIC_AC
#if DECODE_HITACHI_AC
if (results->decode_type == HITACHI_AC) {
IRHitachiAc ac(0);
ac.setRaw(results->state);
description = ac.toString();
}
#endif // DECODE_HITACHI_AC
#if DECODE_WHIRLPOOL_AC
if (results->decode_type == WHIRLPOOL_AC) {
IRWhirlpoolAc ac(0);
ac.setRaw(results->state);
description = ac.toString();
}
#endif // DECODE_WHIRLPOOL_AC
#if DECODE_VESTEL_AC
if (results->decode_type == VESTEL_AC) {
IRVestelAc ac(0);
ac.setRaw(results->value); // Like Coolix, use value instead of state.
description = ac.toString();
}
#endif // DECODE_VESTEL_AC
#if DECODE_TECO
if (results->decode_type == TECO) {
IRTecoAc ac(0);
ac.setRaw(results->value); // Like Coolix, use value instead of state.
description = ac.toString();
}
#endif // DECODE_TECO
#if DECODE_TCL112AC
if (results->decode_type == TCL112AC) {
IRTcl112Ac ac(0);
ac.setRaw(results->state);
description = ac.toString();
}
#endif // DECODE_TCL112AC
if (description != "") Serial.println("Mesg Desc.: " + description);
}
void setup() {
Serial.begin(kBaudRate, SERIAL_8N1, SERIAL_TX_ONLY);
while (!Serial) // Wait for the serial connection to be establised.
delay(50);
Serial.println();
Serial.print("IRrecvDumpV2 is now running and waiting for IR input on Pin ");
Serial.println(kRecvPin);
#if DECODE_HASH
// Ignore messages with less than minimum on or off pulses.
irrecv.setUnknownThreshold(kMinUnknownSize);
#endif // DECODE_HASH
irrecv.enableIRIn(); // Start the receiver
}
void loop() {
// Check if the IR code has been received.
if (irrecv.decode(&results)) {
// Display a crude timestamp.
uint32_t now = millis();
Serial.printf("Timestamp : %06u.%03u\n", now / 1000, now % 1000);
if (results.overflow)
Serial.printf(
"WARNING: IR code is too big for buffer (>= %d). "
"This result shouldn't be trusted until this is resolved. "
"Edit & increase kCaptureBufferSize.\n",
kCaptureBufferSize);
// Display the basic output of what we found.
Serial.print(resultToHumanReadableBasic(&results));
dumpACInfo(&results); // Display any extra A/C info if we have it.
yield(); // Feed the WDT as the text output can take a while to print.
// Display the library version the message was captured with.
Serial.print("Library : v");
Serial.println(_IRREMOTEESP8266_VERSION_);
Serial.println();
// Output RAW timing info of the result.
Serial.println(resultToTimingInfo(&results));
yield(); // Feed the WDT (again)
// Output the results as source code
Serial.println(resultToSourceCode(&results));
Serial.println(""); // Blank line between entries
yield(); // Feed the WDT (again)
}
}
Transmitte Data
ArduinoYour code is different. Just you have to edit Firebase host, Auth and that IR decoded code (ex. uint16_t d1[67] = {9040, 4524, 550, 560, 550, 1696, 548, 560, 550, 560, 548, 560, 550, 560, 550, 560, 550, 560, 550, 1696, 550, 560, 550, 1696, 550, 1696, 548, 1696, 550, 1696, 548, 1696, 550, 1696, 548, 560, 548, 560, 550, 560, 550, 1694, 550, 560, 550, 560, 550, 1696, 548, 560, 550, 1696, 548, 1696, 548, 1696, 550, 560, 550, 1696, 550, 1696, 550, 560, 550, 1696, 550}; // NEC 40BF12ED ).
#ifndef UNIT_TEST
#include <Arduino.h>
#endif
#include <ESP8266WiFi.h>
#include<FirebaseArduino.h>
#include <DNSServer.h>
#include <ESP8266WebServer.h>
#include <WiFiManager.h>
#include <IRremoteESP8266.h>
#include <IRsend.h>
#define FIREBASE_HOST "xxxxxxxxxxxxxxxxxx" //Your Firebase Project URL goes here without "http:" , "\" and "/"
#define FIREBASE_AUTH "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" //Your Firebase Database Secret goes here
#define IR D7
int power, mute, source, tone1, next, previous, volup, voldown, playpause, one, two, three, four, five, six, seven, eight, nine, zero;
const uint16_t kIrLed = D7;
IRsend irsend(kIrLed);
void setup()
{
irsend.begin();
Serial.begin(115200, SERIAL_8N1, SERIAL_TX_ONLY);
pinMode(IR,OUTPUT);
WiFiManager wifiManager;
wifiManager.autoConnect("Elcopair_DM#001");
Serial.println("Connected...");
while (WiFi.status()!=WL_CONNECTED)
{
Serial.print(".");
delay(500);
}
Serial.println(WiFi.localIP());
Firebase.begin(FIREBASE_HOST,FIREBASE_AUTH);
}
void firebasereconnect()
{
Firebase.begin(FIREBASE_HOST, FIREBASE_AUTH);
Serial.println("Trying to reconnect");
ESP.restart();
delay(1000);
}
void loop()
{
if (Firebase.failed())
{
Serial.print("setting number failed:");
Serial.println(Firebase.error());
setup();
firebasereconnect();
return;
}
power=Firebase.getString("power").toInt();
mute=Firebase.getString("mute").toInt();
source=Firebase.getString("source").toInt();
tone1=Firebase.getString("tone1").toInt();
next=Firebase.getString("next").toInt();
previous=Firebase.getString("previous").toInt();
volup=Firebase.getString("volup").toInt();
voldown=Firebase.getString("voldown").toInt();
playpause=Firebase.getString("playpause").toInt();
one=Firebase.getString("one").toInt();
two=Firebase.getString("two").toInt();
three=Firebase.getString("three").toInt();
four=Firebase.getString("four").toInt();
five=Firebase.getString("five").toInt();
six=Firebase.getString("six").toInt();
seven=Firebase.getString("seven").toInt();
eight=Firebase.getString("eight").toInt();
nine=Firebase.getString("nine").toInt();
zero=Firebase.getString("zero").toInt();
if(power==0)
{
uint16_t d1[67] = {9040, 4524, 550, 560, 550, 1696, 548, 560, 550, 560, 548, 560, 550, 560, 550, 560, 550, 560, 550, 1696, 550, 560, 550, 1696, 550, 1696, 548, 1696, 550, 1696, 548, 1696, 550, 1696, 548, 560, 548, 560, 550, 560, 550, 1694, 550, 560, 550, 560, 550, 1696, 548, 560, 550, 1696, 548, 1696, 548, 1696, 550, 560, 550, 1696, 550, 1696, 550, 560, 550, 1696, 550}; // NEC 40BF12ED
irsend.sendRaw(d1, 67, 38); // Send a raw data capture at 38kHz.
Serial.println("POWER");
Firebase.setString("power","1");
}
if(mute==0)
{
uint16_t d2[71] = {9052, 4524, 550, 560, 550, 1696, 552, 560, 550, 560, 550, 560, 550, 560, 550, 560, 552, 560, 550, 1696, 552, 560, 552, 1696, 550, 1698, 550, 1698, 552, 1696, 552, 1698, 552, 1696, 552, 1696, 552, 560, 550, 560, 552, 1696, 552, 560, 552, 560, 550, 1698, 550, 560, 552, 560, 552, 1698, 550, 1696, 552, 560, 550, 1696, 552, 1696, 550, 560, 550, 1696, 552, 40554, 9050, 2250, 550}; // NEC 40BF926D
irsend.sendRaw(d2, 67, 38); // Send a raw data capture at 38kHz.
Serial.println("MUTE");
Firebase.setString("mute","1");
}
if(source==0)
{
uint16_t d3[71] = {9398, 4140, 578, 558, 552, 1694, 578, 530, 552, 558, 552, 558, 552, 558, 552, 558, 552, 556, 552, 1694, 550, 558, 552, 1694, 550, 1696, 550, 1696, 550, 1694, 552, 1692, 552, 1694, 576, 1668, 576, 532, 552, 1696, 550, 1694, 550, 558, 550, 558, 552, 556, 552, 556, 552, 558, 552, 1694, 550, 558, 552, 556, 552, 1696, 550, 1696, 550, 1694, 552, 1694, 552, 40540, 9042, 2252, 576}; // NEC 40BFB04F
irsend.sendRaw(d3, 67, 38); // Send a raw data capture at 38kHz.
Serial.println("Source");
Firebase.setString("source","1");
}
if(tone1==0)
{
uint16_t d4[73] = {9042, 4524, 548, 562, 548, 1698, 550, 560, 550, 560, 550, 560, 550, 560, 550, 560, 552, 560, 550, 1696, 550, 560, 550, 1696, 550, 1696, 550, 1696, 550, 1696, 550, 1696, 550, 1698, 548, 1696, 548, 560, 550, 558, 552, 1694, 552, 1696, 550, 558, 552, 556, 552, 558, 552, 558, 552, 1694, 550, 1696, 550, 560, 550, 560, 552, 1696, 550, 1696, 550, 1694, 552, 40538, 9074, 202, 158, 1864, 550}; // NEC 40BF9867
irsend.sendRaw(d4, 67, 38); // Send a raw data capture at 38kHz.
Serial.println("Tone");
Firebase.setString("tone1","1");
}
if(next==0)
{
uint16_t d5[73] = {9044, 4526, 548, 562, 548, 1698, 550, 560, 548, 560, 550, 560, 550, 560, 548, 560, 548, 560, 548, 1698, 550, 560, 548, 1696, 550, 1696, 548, 1698, 550, 1696, 548, 1698, 548, 1696, 548, 562, 548, 560, 550, 560, 548, 562, 548, 560, 548, 562, 548, 1698, 550, 560, 548, 1698, 550, 1696, 548, 1696, 550, 1696, 548, 1698, 548, 1698, 548, 560, 548, 1698, 548, 40542, 9042, 2252, 550}; // NEC 40BF02FD
irsend.sendRaw(d5, 67, 38); // Send a raw data capture at 38kHz.
Serial.println("Next");
Firebase.setString("next","1");
}
if(previous==0)
{
uint16_t d6[73] = {9040, 4522, 550, 560, 550, 1696, 550, 560, 550, 560, 548, 560, 550, 560, 550, 560, 550, 560, 548, 1696, 550, 560, 548, 1696, 550, 1696, 550, 1698, 548, 1696, 550, 1696, 550, 1696, 550, 560, 550, 560, 550, 1696, 550, 560, 550, 560, 550, 560, 550, 1696, 550, 560, 550, 1696, 550, 1696, 550, 560, 550, 1696, 548, 1698, 548, 1696, 550, 560, 550, 1698, 548}; // NEC 40BF22DD
irsend.sendRaw(d6, 67, 38); // Send a raw data capture at 38kHz.
Serial.println("Previous");
Firebase.setString("previous","1");
}
if(volup==0)
{
uint16_t d6[73] = {9038, 4524, 548, 562, 548, 1696, 550, 560, 550, 560, 548, 562, 548, 562, 548, 562, 548, 562, 548, 1698, 548, 560, 548, 1698, 548, 1696, 548, 1696, 548, 1696, 548, 1696, 548, 1696, 548, 1696, 548, 560, 548, 1698, 548, 560, 548, 562, 548, 562, 548, 562, 548, 562, 548, 560, 548, 1698, 548, 560, 548, 1698, 548, 1696, 548, 1696, 548, 1698, 548, 1696, 550}; // NEC 40BFA05F
irsend.sendRaw(d6, 67, 38); // Send a raw data capture at 38kHz.
Serial.println("Vol Up");
Firebase.setString("volup","1");
}
if(voldown==0)
{
uint16_t d7[73] = {9038, 4522, 522, 588, 548, 1698, 548, 560, 548, 562, 548, 562, 548, 562, 548, 562, 546, 562, 548, 1698, 548, 560, 548, 1698, 548, 1698, 548, 1698, 548, 1696, 548, 1698, 548, 1696, 550, 1696, 548, 1696, 548, 1696, 548, 1698, 548, 560, 548, 562, 548, 562, 548, 560, 548, 562, 548, 562, 548, 562, 548, 562, 548, 1698, 550, 1696, 548, 1696, 550, 1696, 548, 40540, 9040, 2252, 550}; // NEC 40BFF00F
irsend.sendRaw(d7, 67, 38); // Send a raw data capture at 38kHz.
Serial.println("Vol Down");
Firebase.setString("voldown","1");
}
if(playpause==0)
{
uint16_t d8[75] = {9144, 4434, 548, 562, 548, 1698, 550, 560, 550, 562, 548, 562, 550, 560, 550, 560, 550, 562, 550, 1698, 548, 560, 550, 1696, 550, 1698, 548, 1696, 550, 1696, 548, 1696, 550, 1696, 548, 1698, 548, 1698, 550, 560, 550, 560, 550, 562, 548, 560, 550, 1698, 548, 560, 550, 560, 550, 560, 550, 1698, 550, 1696, 550, 1696, 550, 1696, 550, 560, 548, 1698, 548, 40530, 9050, 2252, 546, 22876, 326, 1368, 350}; // NEC 40BFC23D
irsend.sendRaw(d8, 67, 38); // Send a raw data capture at 38kHz.
Serial.println("Play Pause");
Firebase.setString("playpause","1");
}
if(one==0)
{
uint16_t d9[75] = {9086, 4524, 554, 560, 554, 1696, 554, 560, 552, 560, 552, 560, 552, 560, 552, 560, 554, 560, 552, 1698, 552, 560, 554, 1696, 554, 1696, 552, 1696, 554, 1696, 554, 1696, 578, 1672, 554, 558, 554, 560, 578, 1672, 578, 1670, 554, 560, 552, 560, 552, 560, 554, 560, 554, 1696, 552, 1696, 552, 562, 554, 558, 554, 1696, 552, 1696, 554, 1696, 554, 1698, 552, 40528, 9104, 2250, 550, 11248, 66}; // NEC 40BF30CF
irsend.sendRaw(d9, 67, 38); // Send a raw data capture at 38kHz.
Serial.println("One");
Firebase.setString("one","1");
}
if(two==0)
{
uint16_t d10[75] = {9094, 4524, 552, 560, 552, 1696, 552, 562, 552, 562, 552, 560, 552, 562, 552, 560, 552, 562, 552, 1696, 552, 560, 552, 1696, 552, 1696, 552, 1696, 552, 1696, 552, 1696, 552, 1698, 552, 560, 552, 560, 552, 562, 552, 1698, 552, 1698, 552, 560, 552, 562, 552, 560, 552, 1696, 552, 1698, 552, 1696, 552, 562, 552, 562, 552, 1696, 552, 1698, 552, 1698, 552, 18074, 258, 22208, 9106, 2252, 550}; // NEC 40BF18E7
irsend.sendRaw(d10, 67, 38); // Send a raw data capture at 38kHz.
Serial.println("Two");
Firebase.setString("two","1");
}
if(three==0)
{
uint16_t d11[75] = {9098, 4522, 524, 588, 552, 1698, 552, 562, 552, 560, 552, 562, 552, 562, 552, 562, 552, 562, 552, 1678, 600, 532, 552, 1696, 552, 1696, 550, 1698, 550, 1698, 550, 1698, 550, 1698, 550, 562, 550, 1698, 550, 1696, 550, 1698, 550, 1698, 550, 562, 550, 1698, 550, 562, 550, 1698, 550, 562, 550, 562, 550, 562, 550, 562, 550, 1696, 550, 562, 550, 1696, 550, 40526, 9088, 2250, 524}; // NEC 40BF7A85
irsend.sendRaw(d11, 67, 38); // Send a raw data capture at 38kHz.
Serial.println("Three");
Firebase.setString("three","1");
}
if(four==0)
{
uint16_t d12[75] = {9088, 4522, 550, 562, 550, 1696, 550, 560, 550, 562, 550, 558, 560, 556, 550, 562, 550, 562, 550, 1698, 550, 560, 552, 1696, 552, 1698, 550, 1698, 550, 1696, 550, 1696, 550, 1696, 552, 560, 550, 562, 552, 560, 552, 1696, 550, 562, 550, 560, 550, 562, 552, 560, 550, 1696, 552, 1696, 552, 1696, 550, 562, 550, 1698, 550, 1696, 552, 1696, 550, 1696, 552, 40536, 9078, 2252, 548}; // NEC 40BF10EF
irsend.sendRaw(d12, 67, 38); // Send a raw data capture at 38kHz.
Serial.println("Four");
Firebase.setString("four","1");
}
if(five==0)
{
uint16_t d13[75] = {9078, 4524, 550, 562, 550, 1698, 552, 560, 550, 562, 550, 562, 550, 562, 550, 562, 550, 562, 550, 1698, 552, 560, 550, 1698, 550, 1698, 550, 1698, 552, 1698, 550, 1698, 550, 1698, 550, 562, 550, 562, 550, 1698, 556, 1692, 550, 1696, 552, 560, 552, 560, 550, 562, 550, 1698, 550, 1696, 550, 562, 550, 562, 550, 560, 550, 1698, 550, 1696, 550, 1698, 550, 40540, 9078, 2252, 524}; // NEC 40BF38C7
irsend.sendRaw(d13, 67, 38); // Send a raw data capture at 38kHz.
Serial.println("Five");
Firebase.setString("five","1");
}
if(six==0)
{
uint16_t d14[75] = {9464, 4150, 552, 560, 554, 1696, 554, 558, 554, 558, 554, 558, 554, 558, 554, 558, 554, 558, 554, 1696, 552, 558, 554, 1696, 552, 1696, 550, 1696, 552, 1696, 552, 1696, 552, 1696, 550, 560, 552, 1696, 552, 560, 554, 1696, 552, 1696, 552, 558, 554, 1696, 550, 560, 552, 1696, 552, 560, 554, 1696, 552, 558, 554, 558, 554, 1696, 552, 560, 552, 1694, 552, 40534, 9082, 2252, 550}; // NEC 40BF5AA5
irsend.sendRaw(d14, 67, 38); // Send a raw data capture at 38kHz.
Serial.println("Six");
Firebase.setString("six","1");
}
if(seven==0)
{
uint16_t d15[75] = {9080, 4526, 548, 564, 550, 1698, 550, 560, 550, 562, 550, 560, 552, 560, 550, 562, 550, 562, 552, 1696, 552, 560, 552, 1698, 552, 1696, 552, 1696, 550, 1696, 554, 1692, 552, 1696, 550, 560, 552, 1696, 552, 560, 550, 562, 550, 560, 552, 560, 552, 1696, 550, 560, 552, 1696, 550, 562, 552, 1696, 550, 1698, 552, 1696, 550, 1698, 550, 562, 550, 1696, 552, 40534, 9082, 2252, 548}; // NEC 40BF42BD
irsend.sendRaw(d15, 67, 38); // Send a raw data capture at 38kHz.
Serial.println("Seven");
Firebase.setString("seven","1");
}
if(eight==0)
{
uint16_t d16[75] = {9086, 4524, 552, 562, 550, 1698, 550, 562, 550, 562, 552, 560, 552, 560, 550, 562, 550, 562, 550, 1698, 550, 562, 550, 1698, 550, 1696, 550, 1698, 550, 1698, 550, 1696, 550, 1696, 550, 560, 550, 1698, 550, 562, 550, 562, 550, 1696, 550, 560, 550, 1698, 550, 560, 548, 1700, 550, 560, 550, 1698, 550, 1698, 550, 562, 548, 1698, 550, 560, 550, 1698, 550, 40536, 9078, 2252, 550}; // NEC 40BF4AB5
irsend.sendRaw(d16, 67, 38); // Send a raw data capture at 38kHz.
Serial.println("Eight");
Firebase.setString("eight","1");
}
if(nine==0)
{
uint16_t d17[75] = {9060, 4524, 548, 562, 550, 1698, 550, 560, 550, 562, 548, 562, 550, 562, 550, 560, 550, 562, 548, 1698, 550, 562, 550, 1696, 550, 1696, 550, 1698, 550, 1698, 548, 1698, 550, 1696, 550, 560, 550, 1698, 550, 560, 550, 1698, 550, 562, 548, 562, 550, 1698, 548, 562, 548, 1698, 550, 562, 548, 1698, 550, 560, 550, 1698, 550, 1696, 550, 562, 550, 1698, 550, 40556, 9038, 2252, 528}; // NEC 40BF52AD
irsend.sendRaw(d17, 67, 38); // Send a raw data capture at 38kHz.
Serial.println("Nine");
Firebase.setString("nine","1");
}
if(zero==0)
{
uint16_t d18[75] = {9494, 4104, 550, 560, 550, 1696, 552, 560, 552, 558, 552, 558, 552, 560, 552, 560, 552, 560, 550, 1696, 552, 560, 552, 1696, 550, 1696, 550, 1696, 550, 1696, 550, 1698, 550, 1696, 550, 560, 550, 1698, 552, 1696, 550, 562, 550, 1698, 550, 560, 550, 562, 550, 560, 552, 1696, 550, 560, 550, 560, 550, 1698, 550, 560, 550, 1696, 550, 1698, 550, 1698, 550, 40536, 9390, 1920, 548}; // NEC 40BF6897
irsend.sendRaw(d18, 67, 38); // Send a raw data capture at 38kHz.
Serial.println("zero");
Firebase.setString("zero","1");
}
}
Comments