mirror of
https://github.com/Theaninova/Arduino-IRremote.git
synced 2025-12-12 17:36:15 +00:00
Add Sharp and DISH transmission support.
This change is from Todd Treece: http://arcfn.com/2009/08/multi-protocol-infrared-remote-library.html?showComment=1264093513759#c3138785324309374640
This commit is contained in:
72
IRremote.cpp
72
IRremote.cpp
@@ -652,3 +652,75 @@ long IRrecv::decodeHash(decode_results *results) {
|
||||
results->decode_type = UNKNOWN;
|
||||
return DECODED;
|
||||
}
|
||||
|
||||
/* Sharp and DISH support by Todd Treece
|
||||
|
||||
The Dish send function needs to be repeated 4 times and the Sharp function
|
||||
has the necessary repeats built in. I know that it's not consistent,
|
||||
but I don't have the time to update my code.
|
||||
|
||||
Here are the LIRC files that I found that seem to match the remote codes
|
||||
from the oscilloscope:
|
||||
|
||||
Sharp LCD TV:
|
||||
http://lirc.sourceforge.net/remotes/sharp/GA538WJSA
|
||||
|
||||
DISH NETWORK (echostar 301):
|
||||
http://lirc.sourceforge.net/remotes/echostar/301_501_3100_5100_58xx_59xx
|
||||
|
||||
For the DISH codes, only send the last for characters of the hex.
|
||||
i.e. use 0x1C10 instead of 0x0000000000001C10 which is listed in the
|
||||
linked LIRC file.
|
||||
*/
|
||||
|
||||
void IRsend::sendSharp(unsigned long data, int nbits) {
|
||||
unsigned long invertdata = data ^ SHARP_TOGGLE_MASK;
|
||||
enableIROut(38);
|
||||
for (int i = 0; i < nbits; i++) {
|
||||
if (data & 0x4000) {
|
||||
mark(SHARP_BIT_MARK);
|
||||
space(SHARP_ONE_SPACE);
|
||||
}
|
||||
else {
|
||||
mark(SHARP_BIT_MARK);
|
||||
space(SHARP_ZERO_SPACE);
|
||||
}
|
||||
data <<= 1;
|
||||
}
|
||||
|
||||
mark(SHARP_BIT_MARK);
|
||||
space(SHARP_ZERO_SPACE);
|
||||
delay(46);
|
||||
for (int i = 0; i < nbits; i++) {
|
||||
if (invertdata & 0x4000) {
|
||||
mark(SHARP_BIT_MARK);
|
||||
space(SHARP_ONE_SPACE);
|
||||
}
|
||||
else {
|
||||
mark(SHARP_BIT_MARK);
|
||||
space(SHARP_ZERO_SPACE);
|
||||
}
|
||||
invertdata <<= 1;
|
||||
}
|
||||
mark(SHARP_BIT_MARK);
|
||||
space(SHARP_ZERO_SPACE);
|
||||
delay(46);
|
||||
}
|
||||
|
||||
void IRsend::sendDISH(unsigned long data, int nbits)
|
||||
{
|
||||
enableIROut(56);
|
||||
mark(DISH_HDR_MARK);
|
||||
space(DISH_HDR_SPACE);
|
||||
for (int i = 0; i < nbits; i++) {
|
||||
if (data & DISH_TOP_BIT) {
|
||||
mark(DISH_BIT_MARK);
|
||||
space(DISH_ONE_SPACE);
|
||||
}
|
||||
else {
|
||||
mark(DISH_BIT_MARK);
|
||||
space(DISH_ZERO_SPACE);
|
||||
}
|
||||
data <<= 1;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user