Skip to content

Commit d7627fb

Browse files
author
Matthias Neeracher
committed
Add RC-MM code to demo programs
1 parent 452eaea commit d7627fb

File tree

4 files changed

+27
-1
lines changed

4 files changed

+27
-1
lines changed

examples/IRrecord/IRrecord.ino

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,11 @@ void sendCode(int repeat) {
133133
Serial.println(codeValue, HEX);
134134
}
135135
}
136+
else if (codeType == RCMM) {
137+
irsend.sendRCMM(codeValue, codeLen);
138+
Serial.print("Sent RCMM ");
139+
Serial.println(codeValue, HEX);
140+
}
136141
else if (codeType == UNKNOWN /* i.e. raw */) {
137142
// Assume 38 KHz
138143
irsend.sendRaw(rawCodes, codeLen, 38);

examples/IRrecvDump/IRrecvDump.ino

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
* Copyright 2009 Ken Shirriff
66
* http://arcfn.com
77
* JVC and Panasonic protocol added by Kristian Lauszus (Thanks to zenwheel and other people at the original blog post)
8+
* RCMM protocol added by Matthias Neeracher
89
*/
910

1011
#include <IRremote.h>
@@ -51,6 +52,9 @@ void dump(decode_results *results) {
5152
else if (results->decode_type == JVC) {
5253
Serial.print("Decoded JVC: ");
5354
}
55+
else if (results->decode_type == RCMM) {
56+
Serial.print("Decoded RCMM: ");
57+
}
5458
Serial.print(results->value, HEX);
5559
Serial.print(" (");
5660
Serial.print(results->bits, DEC);
@@ -64,7 +68,7 @@ void dump(decode_results *results) {
6468
Serial.print(results->rawbuf[i]*USECPERTICK, DEC);
6569
}
6670
else {
67-
Serial.print(-(int)results->rawbuf[i]*USECPERTICK, DEC);
71+
Serial.print(-(long)results->rawbuf[i]*USECPERTICK, DEC);
6872
}
6973
Serial.print(" ");
7074
}

examples/IRrelay/IRrelay.ino

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,9 @@ void dump(decode_results *results) {
3737
else if (results->decode_type == RC6) {
3838
Serial.print("Decoded RC6: ");
3939
}
40+
else if (results->decode_type == RCMM) {
41+
Serial.print("Decoded RCMM: ");
42+
}
4043
Serial.print(results->value, HEX);
4144
Serial.print(" (");
4245
Serial.print(results->bits, DEC);

examples/IRtest/IRtest.ino

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,9 @@ void dump(decode_results *results) {
3535
else if (results->decode_type == RC6) {
3636
Serial.print("Decoded RC6: ");
3737
}
38+
else if (results->decode_type == RCMM) {
39+
Serial.print("Decoded RCMM: ");
40+
}
3841
Serial.print(results->value, HEX);
3942
Serial.print(" (");
4043
Serial.print(results->bits, DEC);
@@ -152,6 +155,11 @@ void testRC6(unsigned long val, int bits) {
152155
irsenddummy.sendRC6(val, bits);
153156
verify(val, bits, RC6);
154157
}
158+
void testRCMM(unsigned long val, int bits) {
159+
irsenddummy.reset();
160+
irsenddummy.sendRCMM(val, bits);
161+
verify(val, bits, RCMM);
162+
}
155163

156164
void test() {
157165
Serial.println("NEC tests");
@@ -178,6 +186,12 @@ void test() {
178186
testRC6(0xaaaaa, 20);
179187
testRC6(0x55555, 20);
180188
testRC6(0x12345, 20);
189+
Serial.println("RCMM tests");
190+
testNEC(0x00000000, 32);
191+
testNEC(0xffffffff, 32);
192+
testNEC(0xaaaaaaaa, 32);
193+
testNEC(0x55555555, 32);
194+
testNEC(0x12345678, 32);
181195
}
182196

183197
void setup()

0 commit comments

Comments
 (0)