Last active
April 29, 2020 10:39
-
-
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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