![](https://static.wixstatic.com/media/a27d24_8fc87663e35e4ad9992447615822cdb3~mv2_d_1755_1389_s_2.png/v1/fill/w_980,h_776,al_c,q_90,usm_0.66_1.00_0.01,enc_auto/a27d24_8fc87663e35e4ad9992447615822cdb3~mv2_d_1755_1389_s_2.png)
#include <IRremote.h>
IRrecv irrecv(12);
decode_results results;
#define BUTON1 0xFFA25D
#define BUTON2 0xFF629D
#define BUTON3 0xFFE21D
#define BUTON4 0xFF22DD
#define BUTON5 0xFF02FD
#define BUTON6 0xFFC23D
#define BUTON7 0xFFE01F
#define BUTON8 0xFFA857
#define BUTON9 0xFF906F
#define YILDIZ 0xFF6897
#define BUTON0 0xFF9867
int rpin = 3;
int gpin = 5;
int bpin = 6;
void setup()
{
pinMode(rpin, OUTPUT);
pinMode(gpin, OUTPUT);
pinMode(bpin, OUTPUT);
pinMode(led4, OUTPUT);
Serial.begin(9600);
irrecv.enableIRIn();
}
void loop() {
if (irrecv.decode(&results))
{
Serial.println(results.value, HEX);
if (results.value == BUTON1)
{
digitalWrite(rpin, HIGH);
digitalWrite(gpin, LOW);
digitalWrite(bpin, LOW);
}
if (results.value == BUTON2)
{
digitalWrite(rpin, LOW);
digitalWrite(gpin, HIGH);
digitalWrite(bpin, LOW);
}
if (results.value == BUTON3)
{
digitalWrite(rpin, LOW);
digitalWrite(gpin, LOW);
digitalWrite(bpin, HIGH);
}
//TURUNCU
if (results.value == BUTON4)
{
analogWrite(rpin, 255);
analogWrite(gpin, 12);
analogWrite(bpin, 0);
}
//sarı
if (results.value == BUTON7)
{
analogWrite(rpin, 255);
analogWrite(gpin, 111);
analogWrite(bpin, 0);
}
//tukuaz
if (results.value == BUTON5)
{
analogWrite(rpin, 0);
analogWrite(gpin, 255);
analogWrite(bpin, 120);
}
if (results.value == BUTON8)
{
analogWrite(rpin, 255);
analogWrite(gpin, 255);
analogWrite(bpin, 255);
}
if (results.value == BUTON9)
{
analogWrite(rpin, 255);
analogWrite(gpin, 0);
analogWrite(bpin, 255);
}
if (results.value == BUTON6)
{
analogWrite(rpin, 0);
analogWrite(gpin, 245);
analogWrite(bpin, 255);
}
if (results.value == BUTON0)
{
analogWrite(rpin, 255);
analogWrite(gpin, 10);
analogWrite(bpin, 10);
}
if (results.value == YILDIZ)
{
analogWrite(rpin, 0);
analogWrite(gpin, 0);
analogWrite(bpin, 0);
}
irrecv.resume();
}
}
arduino ır kütüpane
https://yadi.sk/d/Z4LsP5LYvDJdp
Comentários