Hi,
I have tried to find codes for a CD player (Denon RCD M38) but I haven't been able to find any information (neither lirc nor irdb.tk)
So I have used this code to find the codes
#include <IRremote.h>
// Define sensor pin
const int RECV_PIN = 2;// Define IR Receiver and Results Objects
IRrecv irrecv(RECV_PIN);
decode_results results;void setup(){
// Serial Monitor @ 9600 baud
Serial.begin(9600);
// Enable the IR Receiver
irrecv.enableIRIn();
}void loop(){
if (irrecv.decode(&results)){
Serial.print(results.value, HEX);
Serial.print(" - ");
Serial.println(results.value);switch (results.decode_type){
case NEC:
Serial.println("NEC");
break;
case SONY:
Serial.println("SONY");
break;
case RC5:
Serial.println("RC5");
break;
case RC6:
Serial.println("RC6");
break;
case DISH:
Serial.println("DISH");
break;
case SHARP:
Serial.println("SHARP");
break;
case JVC:
Serial.println("JVC");
break;
case SANYO:
Serial.println("SANYO");
break;
case MITSUBISHI:
Serial.println("MITSUBISHI");
break;
case SAMSUNG:
Serial.println("SAMSUNG");
break;
case LG:
Serial.println("LG");
break;
case WHYNTER:
Serial.println("WHYNTER");
break;
case AIWA_RC_T501:
Serial.println("AIWA_RC_T501");
break;
case PANASONIC:
Serial.println("PANASONIC");
break;
case DENON:
Serial.println("DENON");
break;
default:
case UNKNOWN:
Serial.println("UNKNOWN");
break;
}
irrecv.resume();
}
}
With this code loaded in an Arduino Genuino, I press the original remote and I get UNKNOWN in the console.
I can read other remotes such as LG TV but for this Denon device is impossible.
Then, I have tried to read raw data with the following code
#define maxLen 800
volatile unsigned int irBuffer[maxLen]; //stores timings - volatile because changed by ISR
volatile unsigned int x = 0; //Pointer thru irBuffer - volatile because changed by ISRvoid setup() {
Serial.begin(115200); //change BAUD rate as required
attachInterrupt(0, rxIR_Interrupt_Handler, CHANGE);//set up ISR for receiving IR signal
}void loop() {
// put your main code here, to run repeatedly:Serial.println(F("Press the button on the remote now - once only"));
delay(5000); // pause 5 secs
if (x) { //if a signal is captured
digitalWrite(LEDPIN, HIGH);//visual indicator that signal received
Serial.println();
Serial.print(F("Raw: (")); //dump raw header format - for library
Serial.print((x - 1));
Serial.print(F(") "));
detachInterrupt(0);//stop interrupts & capture until finshed here
for (int i = 1; i < x; i++) { //now dump the times
if (!(i & 0x1)) Serial.print(F("+"));
Serial.print(irBuffer - irBuffer[i - 1]);
- Serial.print(F(", "));*
_ //Serial.println(irBuffer - irBuffer[i - 1], HEX);_
* //Serial.print(F(", "));*
* }*
* x = 0;*
* Serial.println();*
* Serial.println();*
* digitalWrite(LEDPIN, LOW);//end of visual indicator, for this time*
* attachInterrupt(0, rxIR_Interrupt_Handler, CHANGE);//re-enable ISR for receiving IR signal*
* }*
}
void rxIR_Interrupt_Handler() {
* if (x > maxLen) return; //ignore if irBuffer is already full*
* irBuffer[x++] = micros(); //just continually record the time-stamp of signal transitions*
}
[/quote]
And I get an array that I send with this code:
> #include <IRremote.h>
>
> IRsend irsend;
>
> //int irPin = 9; // pin IR led
>
> int khz = 38;
>
>
> void setup()
>
> {
> Serial.begin(115200);
>
> }
>
> void loop() {
>
> // Denon
> unsigned int denon_on[] =
> {3480, +1592, 500, +336, 500, +312, 500, +1140, 436, +372, 532, +1160, 364, +448, 392, +1276, 360, +424, 496, +336, 388, +1280, 360, +452, 464, +344, 404, +1264, 464, +1184, 432, +376, 464, +372, 500, +336, 412, +372, 464, +368, 504, +312, 500, +1140, 468, +340, 504, +1192, 360, +424, 500, +1196, 392, +392, 504, +332, 360, +448, 396, +1272, 404, +1244, 472, +340, 496, +312, 504, +308, 416, +416, 396, +420, 500, +332, 472, +312, 504, +332, 468, +1204, 360, +448, 504, +1168, 360, +452, 360, +424, 528, +308, 500, +312, 504, +1192, 440, +344, 436, +400, 504, +9232, 3456, +1680, 384, +456, 624, +156, 456, +1244, 412, +404, 408, +1240, 408, +384, 408, +1308, 384, +404, 408, +428, 412, +1260, 388, +424, 388};
> Serial.println("Sending denon");
> irsend.sendRaw(denon_on, sizeof(denon_on) / sizeof(unsigned int), khz);
>
> delay(1000);
>
>
>
> }
But it doesn't work. I don't know why.
Any ideas?