Skip to content

Instantly share code, notes, and snippets.

@pol8139
Last active April 29, 2020 10:39
Show Gist options
  • Save pol8139/7b2d41b4c1acd83bbbf57da3cf8b0970 to your computer and use it in GitHub Desktop.
Save pol8139/7b2d41b4c1acd83bbbf57da3cf8b0970 to your computer and use it in GitHub Desktop.
ONKYO TX-L50 のリモコンの信号を受信し、 YAMAHA CDX-620 の信号に変換して送信する。Arduino Unoで動作確認済 https://twitter.com/PoL8139/status/1220927913140211714
#include <IRremote.h>
int recvPin = 11;
// transmit pin = 3
IRrecv irrecv(recvPin);
IRsend irsend;
uint32_t button_map[2][3] {
{0x4B983AC5, 0x4B4009F6, 0x4B40F10E},
{0x5EA110EF, 0x5EA1D02F, 0x5EA150AF}
};
void setup()
{
irrecv.enableIRIn();
}
void loop() {
decode_results results;
if(irrecv.decode(&results)) {
delay(200);
for(int i = 0; i < 3; i++) {
if(results.value == button_map[0][i]) {
irsend.sendNEC(button_map[1][i], 32);
}
}
irrecv.resume();
irrecv.enableIRIn();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment