Skip to content

Instantly share code, notes, and snippets.

@swalberg
Last active December 11, 2015 09:49
Show Gist options
  • Save swalberg/4582894 to your computer and use it in GitHub Desktop.
Save swalberg/4582894 to your computer and use it in GitHub Desktop.
#include <IRremote.h>
IRsend irsend;
void setup()
{
Serial.begin(9600);
}
unsigned long code;
char input;
void loop() {
for (int i=0; i < 1; i++) { // have been playing with repeats
irsend.sendNEC(0xbff8, 16);
delay(200);
}
delay(2000);
}
sean@mythupstairs:~$ cat /usr/share/lirc/extras/transmitters/motorola/dctxxxx.conf
#
# this config file was automatically generated
# using lirc-0.6.6(serial) on Fri Mar 28 22:46:44 2003
#
# contributed by shane bradley
#
#
#
# brand: Motorola
# model no. of remote control: DCT2000
# devices being controlled by this remote:
#
begin remote
name DCT2000
bits 16
flags SPACE_ENC|CONST_LENGTH
eps 30
aeps 100
header 9036 4424
one 556 2185
zero 556 4424
ptrail 556
gap 100025
toggle_bit 0
begin codes
HELP 0x000000000000B3F2
POWER 0x000000000000AFF9
MUTE 0x0000000000000FF7
PAGE+ 0x000000000000A3F3
PAGE- 0x00000000000023FB
LOCK 0x00000000000097F6
EXIT 0x000000000000B7F4
AUP 0x000000000000D3F6
ADOWN 0x00000000000053FE
ALEFT 0x00000000000093F1
ARIGHT 0x00000000000013F9
OK 0x00000000000077F8
GUIDE 0x000000000000F3F4
MENU 0x00000000000067F9
VOL+ 0x0000000000004FF3
VOL- 0x0000000000008FFB
LAST 0x00000000000037FC
FAV 0x00000000000057FA
CH+ 0x0000000000002FF5
CH- 0x000000000000CFFD
A 0x00000000000017FE
B 0x0000000000001BF1
C 0x000000000000EBF9
1 0x0000000000007FF0
2 0x000000000000BFF8
3 0x0000000000003FF4
4 0x000000000000DFFC
5 0x0000000000005FF2
6 0x0000000000009FFA
7 0x0000000000001FF6
8 0x000000000000EFFE
9 0x0000000000006FF1
0 0x000000000000FFFF
BYPASS 0x000000000000D7F2
MUSIC 0x000000000000F7F0
STOP 0x00000000000063FD
PAUSE 0x00000000000007FF
PLAY 0x000000000000E3F5
REW 0x00000000000087F7
REC 0x00000000000073FC
FFWD 0x00000000000047FB
end codes
end remote
void IRsend::sendDCT(unsigned long data, int nbits)
{
enableIROut(38);
mark(9036);
space(4424);
for (int i = 0; i < nbits; i++) {
if (data & TOPBIT) {
mark(556);
space(2185);
}
else {
mark(556);
space(4424);
}
data <<= 1;
}
mark(556);
space(0);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment