ELEDTROLED
Published © CC BY

IRremote

Como como encender un led por medio de un vs1838, y un control remoto

BeginnerProtip732
IRremote

Things used in this project

Hardware components

Arduino UNO
Arduino UNO
×1
Jumper wires (generic)
Jumper wires (generic)
×1
Resistor 220 ohm
Resistor 220 ohm
×1
LED (generic)
LED (generic)
×1

Hand tools and fabrication machines

Prototyping Kit, Breadboard
Prototyping Kit, Breadboard

Story

Read more

Schematics

La imagen del VS1838 y sus pines para poderlo conectar

para poder conectarlo con las conexiones de arriba

el esquematico

Code

eL CODIGO

Arduino
#include <IRremote.h>
int receptor = 11;
int led = 13;
IRrecv irrecv(receptor);
decode_results codigo; //OBJETO CODIGO DE CLASE decode_result, oriundo de IRremote.h
 
void setup()
{
  Serial.begin(9600);
  irrecv.enableIRIn(); // INICIA LA RECEPCIÓN
  pinMode(led, OUTPUT);
}
 
void loop()
{
 if (irrecv.decode(&codigo))
 {
Serial.println(codigo.value, HEX);

      if (codigo.value==0xE13DDA28)//CÓDIGO DEL NÚMERO CERO PARA ACTIVAR LED
      {
         digitalWrite(led,HIGH);
      }

      if (codigo.value==0xAD586662)//CÓDIGO DEL NÚMERO UNO PARA DESACTIVAR LED
      {
         digitalWrite(led,LOW);
      }
    
delay(500);
irrecv.resume();

 }
}

Credits

ELEDTROLED

ELEDTROLED

0 projects • 1 follower

Comments