Skip to content

Instantly share code, notes, and snippets.

@yemreeke
Created December 8, 2020 17:53
Show Gist options
  • Save yemreeke/603967e561665607957588fd52360926 to your computer and use it in GitHub Desktop.
Save yemreeke/603967e561665607957588fd52360926 to your computer and use it in GitHub Desktop.
#include <IRremote.h>
IRrecv irrecv(7); //IR alıcının data pini
decode_results results;
int Role=8;
#define PowerTUS 0x1CE3F00F
#define MuteTUS 0x1CE332CD
void setup() {
irrecv.enableIRIn(); //Aktif ediyoruz
pinMode(Role,OUTPUT);
}
void loop() {
if (irrecv.decode(&results)){
//Eğer tuşa basıldığı algılandıysa
if(results.value==PowerTUS) //Röle Aç
digitalWrite(Role,HIGH);
else if(results.value==MuteTUS)//Röle Kapat
digitalWrite(Role,LOW);
irrecv.resume();// Daha sonraki değer için bekle.
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment