Pages: [1]   Go Down
Author Topic: IRRemote library, sending DVD codes.  (Read 536 times)
0 Members and 1 Guest are viewing this topic.
California
Offline Offline
Sr. Member
****
Karma: 2
Posts: 433
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

I'm using this library to send some commands to my DVD player. I've been able to use the library to recognize codes, I had an RC car controlled by a TV remote. But sending codes I don't quite get. I just need to send the power code and play code.

This is what the IRrecDump sketch gives me for the power button:
Quote
E144827D
Decoded NEC: E144827D (32 bits)
Raw (68): 3236 9150 -4450 600 -1650 650 -1650 600 -1650 600 -500 650 -500 600 -500 600 -500 650 -1650 600 -500 600 -1650 650 -500 600 -500 600 -500 650 -1650 600 -500 600 -500 650 -1600 650 -500 600 -500 650 -500 600 -500 600 -500 650 -1650 600 -500 600 -500 650 -1650 600 -1650 600 -1650 650 -1600 650 -1650 600 -500 600 -1650 650
and the play button:
Quote
E1447A85
Decoded NEC: E1447A85 (32 bits)
Raw (68): -15260 9150 -4450 650 -1600 650 -1600 650 -1650 650 -450 650 -450 650 -500 650 -450 650 -1600 650 -500 650 -1600 650 -450 650 -500 650 -450 650 -1600 650 -500 650 -450 650 -500 600 -1650 650 -1600 650 -1600 700 -1600 600 -500 650 -1600 650 -500 600 -1650 650 -450 650 -500 600 -500 650 -450 650 -1650 600 -500 650 -1600 650

I'm not sure if I need to keep track of all those numbers or if I can just use the hex code. When I made the RC car I just used the decoded number in decimal form. I've been trying lots of stuff but so far nothing seems to work.

Thanks
Logged

Switzerland
Offline Offline
Faraday Member
**
Karma: 96
Posts: 4702
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

This is adapted from the example code and sends the power and play button with 1 second delay in between.

Code:
#include <IRremote.h>

IRsend irsend;

void setup()
{
}

void loop() {
  int i;
  for (i = 0; i < 3; i++) {
    irsend.sendNEC(0xE144827D, 32); // Power button
  }
  delay(1000);
  for (i = 0; i < 3; i++) {
    irsend.sendNEC(0xE1447A85, 32); // Play button
  }
  delay(1000);
}
Logged

California
Offline Offline
Sr. Member
****
Karma: 2
Posts: 433
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Thanks.
I was a bit confused by that example code. Is there already a defined pin for the output? Or do I still need to define one?
Logged

Switzerland
Offline Offline
Faraday Member
**
Karma: 96
Posts: 4702
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Yes, there is. On the UNO it's pin 3 (it has to be a PWM output pin of timer 2).
Logged

California
Offline Offline
Sr. Member
****
Karma: 2
Posts: 433
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Aha! Thank you. Next time I will consider spending a few minutes reading instead of hours of trial and error... Maybe.
Logged

Pages: [1]   Go Up
Jump to: