Skip to content

Instantly share code, notes, and snippets.

@YDKK YDKK/IR Send.c
Created Nov 14, 2017

Embed
What would you like to do?
#include <IRremote.h>
IRsend irsend;
int zentouPin = 2;
int syoutouPin = 4;
unsigned int zentouRaw[131] = {
4100, 1600, 650, 250, 600, 1200, 600, 250, 650, 1200,
650, 250, 600, 1200, 650, 250, 600, 1250, 600, 250,
600, 1250, 600, 250, 600, 1200, 650, 1200, 600, 300,
600, 1200, 600, 300, 600, 1250, 550, 1250, 600, 1200,
600, 1250, 600, 300, 550, 300, 600, 1250, 600, 1250,
550, 300, 600, 1200, 600, 1250, 600, 300, 550, 1250,
600, 300, 550, 300, 600, 300, 550, 1300, 550, 300,
550, 350, 550, 350, 550, 300, 600, 300, 550, 300,
600, 300, 550, 1300, 550, 300, 600, 300, 550, 300,
600, 300, 550, 350, 550, 350, 550, 300, 550, 1250,
600, 300, 600, 300, 550, 350, 550, 300, 550, 1300,
550, 300, 550, 350, 550, 1300, 550, 300, 550, 350,
550, 300, 550, 1300, 550, 300, 550, 350, 550, 1300,
550
};
unsigned int syoutouRaw[131] = {
4050, 1650, 650, 250, 600, 1200, 650, 250, 600, 1200,
650, 250, 600, 1250, 600, 250, 600, 1250, 600, 250,
600, 1250, 600, 300, 600, 1200, 600, 1250, 550, 300,
600, 1250, 600, 250, 600, 1250, 600, 1200, 600, 1250,
550, 1300, 550, 300, 600, 300, 550, 1250, 600, 1250,
550, 350, 550, 1250, 550, 1250, 600, 300, 550, 1300,
550, 300, 550, 350, 550, 300, 600, 1250, 550, 350,
550, 300, 550, 350, 550, 300, 550, 350, 550, 350,
550, 300, 600, 300, 550, 1300, 550, 300, 550, 350,
550, 300, 550, 350, 550, 350, 500, 350, 550, 1300,
550, 300, 550, 350, 550, 350, 550, 350, 500, 1300,
500, 400, 500, 350, 550, 1250, 550, 350, 550, 400,
500, 350, 500, 400, 500, 1300, 550, 350, 500, 1300,
550
};
void setup()
{
pinMode(zentouPin, INPUT);
pinMode(syoutouPin, INPUT);
Serial.begin(9600);
}
void loop() {
int button = digitalRead(zentouPin);
if (button == HIGH) {
irsend.sendRaw(zentouRaw, sizeof(zentouRaw) / sizeof(zentouRaw[0]), 38);
delay(100);
}
button = digitalRead(syoutouPin);
if (button == HIGH) {
irsend.sendRaw(syoutouRaw, sizeof(syoutouRaw) / sizeof(syoutouRaw[0]), 38);
delay(100);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.