IR remote example not compiling after modification of library.

I modified the Ken Sherrif’s IR remote to work with Samsung TVs and I’m getting the following error while compiling the IR recieve dump example.

E:\Software\Software development\Arduino\Arduino\arduino-1.0.5\libraries\IRremote\IRremote.cpp: In member function 'void IRsend::sendSamsung(long unsigned int, int)':
E:\Software\Software development\Arduino\Arduino\arduino-1.0.5\libraries\IRremote\IRremote.cpp:73: error: 'SAMSUNG_HDR_MARK' was not declared in this scope
E:\Software\Software development\Arduino\Arduino\arduino-1.0.5\libraries\IRremote\IRremote.cpp:74: error: 'SAMSUNG_HDR_SPACE' was not declared in this scope
E:\Software\Software development\Arduino\Arduino\arduino-1.0.5\libraries\IRremote\IRremote.cpp:77: error: 'SAMSUNG_BIT_MARK' was not declared in this scope
E:\Software\Software development\Arduino\Arduino\arduino-1.0.5\libraries\IRremote\IRremote.cpp:78: error: 'SAMSUNG_ONE_SPACE' was not declared in this scope
E:\Software\Software development\Arduino\Arduino\arduino-1.0.5\libraries\IRremote\IRremote.cpp:81: error: 'SAMSUNG_BIT_MARK' was not declared in this scope
E:\Software\Software development\Arduino\Arduino\arduino-1.0.5\libraries\IRremote\IRremote.cpp:82: error: 'SAMSUNG_ZERO_SPACE' was not declared in this scope
E:\Software\Software development\Arduino\Arduino\arduino-1.0.5\libraries\IRremote\IRremote.cpp:86: error: 'SAMSUNG_BIT_MARK' was not declared in this scope

I’ve attached the modified Irremote.cpp file
Thanks.

IRremote.cpp (28.9 KB)

did it compile before your modifications?

error: 'SAMSUNG_HDR_MARK' was not declared in this scope

Huge clue there.

(what happened to the indentation?)

Sorry for the mis understanding guys. I modified my post with the right words. I suck at programming. So, bear with me.

I've attached the modified Irremote.cpp file

Where's the modified "IRremoteInt.h" file? (Another hint there)

AWOL, I’m unable to understand what you’re saying by “no indentation”

Here are the added Samsung and unmodified NEC ones. They are exactly the same but I’m not getting an error for NEC.

void IRsend::sendSamsung(unsigned long data, int nbits)
{
  enableIROut(38);
  mark(SAMSUNG_HDR_MARK);
  space(SAMSUNG_HDR_SPACE);
  for (int i = 0; i < nbits; i++) {
    if (data & TOPBIT) {
      mark(SAMSUNG_BIT_MARK);
      space(SAMSUNG_ONE_SPACE);
    }
    else {
    mark(SAMSUNG_BIT_MARK);
    space(SAMSUNG_ZERO_SPACE);
    }
   data <<= 1;
  }
  mark(SAMSUNG_BIT_MARK);
  space(0);
}

void IRsend::sendNEC(unsigned long data, int nbits)
{
  enableIROut(38);
  mark(NEC_HDR_MARK);
  space(NEC_HDR_SPACE);
  for (int i = 0; i < nbits; i++) {
    if (data & TOPBIT) {
      mark(NEC_BIT_MARK);
      space(NEC_ONE_SPACE);
    } 
    else {
      mark(NEC_BIT_MARK);
      space(NEC_ZERO_SPACE);
    }
    data <<= 1;
  }
  mark(NEC_BIT_MARK);
  space(0);
}

See reply #4.

(when I downloaded the original file, there was no indentation in your new function

void IRsend::sendSamsung(unsigned long data, int nbits)
{
enableIROut(38);
mark(SAMSUNG_HDR_MARK);
space(SAMSUNG_HDR_SPACE);
for (int i = 0; i < nbits; i++) {
if (data & TOPBIT) {
mark(SAMSUNG_BIT_MARK);
space(SAMSUNG_ONE_SPACE);
}
else {
mark(SAMSUNG_BIT_MARK);
space(SAMSUNG_ZERO_SPACE);
}
data <<= 1;
}
mark(SAMSUNG_BIT_MARK);
space(0);
}

)

In case you didn't get or understand the 'hints'... :)

You may also need to update the following files located in the IRremote directory.

IRremoteInt.h IRremote.h

plus the IRremote.cpp , which you have already done.

....to get it to work with Samsung

These steps should be explained, in more detail, where you found the Samsung modifications.