#include <IRremote.h>
IRsend irsend;
int puls1 = 2;
int puls2 = 7;
int ir_emitter = 3;
void setup()
{
Serial.begin(9600);
pinMode(puls2, INPUT);
pinMode(puls1, INPUT);
pinMode(ir_emitter, OUTPUT);
}
void loop() {
int puls = 0;
int Puls = 0;
puls = digitalRead(puls2);
Puls = digitalRead(puls1);
if (puls == 1) {
const unsigned int on[68] = {4600, 4350, 700, 1550, 650, 1550, 650, 1600, 650, 450, 650, 450, 650, 450, 650, 450, 700, 400, 700, 1550, 650, 1550, 650, 1600, 650, 450, 650, 450, 650, 450, 700, 450, 650, 450, 650, 450, 650, 1550, 700, 450, 650, 450, 650, 450, 650, 450, 650, 450, 700, 400, 650, 1600, 650, 450, 650, 1550, 650, 1600, 650, 1550, 650, 1550, 700, 1550, 650, 1550, 650};
irsend.sendRaw(on, 68, 38);
delay(1000);
}
if (Puls == 1) {
const unsigned int off[68] = {4650, 4300, 700, 1550, 700, 1550, 650, 1550, 700, 400, 700, 400, 700, 400, 700, 450, 700, 400, 700, 1500, 700, 1500, 700, 1550, 700, 450, 650, 400, 700, 450, 650, 450, 700, 400, 700, 400, 700, 450, 650, 1550, 700, 400, 700, 400, 700, 400, 700, 450, 650, 450, 650, 1550, 700, 1500, 700, 450, 650, 1550, 700, 1550, 650, 1550, 700, 1500, 700, 1550, 650};
irsend.sendRaw(off, 68, 38);
delay(1000);
}
}
Comments