YENFU CHEN
Published

Hack a TV Remote

Use any IR remote to control things around you

BeginnerFull instructions provided3 hours41
Hack a TV Remote

Things used in this project

Hardware components

Wemos D1 Mini
Espressif Wemos D1 Mini
×1
IR receiver (generic)
×1

Story

Read more

Schematics

WeMos D1 Mini1 + IR Receiver

Code

Hack a TV Remote

C/C++
WeMos D1 Mini1 + IR Receiver
#include <IRremoteESP8266.h>
#include <IRrecv.h>
#include <IRutils.h>

IRrecv _irrecv(D5);
decode_results _irrecvResult;

void setup() {
  Serial.begin(115200);
  _irrecv.enableIRIn();

  pinMode(D8, OUTPUT);
  digitalWrite(D8, LOW);

}

void loop() {
  if (_irrecv.decode(&_irrecvResult)) {
    Serial.println(uint64ToString(_irrecvResult.value, 16));
    if (uint64ToString(_irrecvResult.value, 16) == u8"FF30CF") {
      pinMode(D8, OUTPUT);
      digitalWrite(D8, HIGH);
    } else if (uint64ToString(_irrecvResult.value, 16) == u8"FF18E7") {
      pinMode(D8, OUTPUT);
      digitalWrite(D8, LOW);
    }
    delay(100);
    _irrecv.resume();
  }

}

Credits

YENFU CHEN

YENFU CHEN

2 projects • 0 followers
A creative technologist, an instructor of digital communication and also an interactive product designer

Comments