Skip to content

Instantly share code, notes, and snippets.

@chaeplin
Last active September 20, 2023 01:19
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chaeplin/7c800d3166463bb51be4 to your computer and use it in GitHub Desktop.
Save chaeplin/7c800d3166463bb51be4 to your computer and use it in GitHub Desktop.
IR SEND RAW
// https://github.com/shirriff/Arduino-IRremote
#include <IRremote.h>
IRsend irsend;
void setup()
{
}
// on
// Raw: (59) 8000, -4000, 520, -1564, 524, -524, 520, -540, 500, -536, 500, -1592, 500, -528, 520, -532, 520, -548, 500, -532, 520, -548, 500, -532, 520, -548, 500, -532, 520, -552, 496, -540, 500, -524, 520, -1584, 500, -1564, 520, -540, 500, -536, 500, -548, 500, -532, 520, -1600, 500, -540, 500, -1576, 500, -1588, 520, -1576, 500, -540, 500,
// off
// Raw: (59) 8000, -4000, 524, -1544, 552, -496, 548, -512, 524, -500, 548, -1556, 528, -520, 524, -500, 548, -520, 528, -1532, 552, -1548, 524, -516, 524, -496, 552, -520, 524, -512, 528, -512, 524, -508, 548, -496, 552, -504, 548, -504, 552, -516, 504, -528, 552, -1572, 500, -536, 504, -1572, 500, -540, 500, -540, 496, -548, 520, -1540, 552,
// on
unsigned int sendbuf1[] = {
8000, 4000, 520, 1564, 524, 524, 520, 540, 500, 536, 500, 1592, 500, 528, 520, 532, 520, 548, 500, 532, 520, 548, 500, 532, 520, 548, 500, 532, 520, 552, 496, 540, 500, 524, 520, 1584, 500, 1564, 520, 540, 500, 536, 500, 548, 500, 532, 520, 1600, 500, 540, 500, 1576, 500, 1588, 520, 1576, 500, 540, 500};
// off
unsigned int sendbuf2[] = {
8000, 4000, 524, 1544, 552, 496, 548, 512, 524, 500, 548, 1556, 528, 520, 524, 500, 548, 520, 528, 1532, 552, 1548, 524, 516, 524, 496, 552, 520, 524, 512, 528, 512, 524, 508, 548, 496, 552, 504, 548, 504, 552, 516, 504, 528, 552, 1572, 500, 536, 504, 1572, 500, 540, 500, 540, 496, 548, 520, 1540, 552};
void loop() {
testRaw("RAW1", sendbuf1, sizeof(sendbuf1)/sizeof(int));
delay(5000);
testRaw("RAW2", sendbuf2, sizeof(sendbuf2)/sizeof(int));
delay(5000);
}
void testRaw(char *label, unsigned int *rawbuf, int rawlen) {
irsend.sendRaw(rawbuf, rawlen, 38 /* kHz */);
delay(200);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment