send HEX Hitachi cooller codes

Hi, I'm trying to turn on/off my hitachi cooler (Nano Titanium)

I have read codes with this program:

void setup()
{
  Serial.begin(9600);
  irrecv.enableIRIn(); // Start the receiver
}

void loop() {
  if (irrecv.decode(&results)) {
    Serial.println(results.value, HEX);
    irrecv.resume(); // Receive the next value
  }
}

I got those values

#define C_On  0xCFBC85E3;  // on
#define C_Off  3D074C55; //off

Now I'm looking for sketch to send those codes but I can't get any examples for sending than

this code does not work

irsend.sendSony(C_On, 12); // Sony TV power code

I have connected IR sending led to pin 13

Any help to send HEX codes?

Thanks

Please post your whole program. Posting just one line is a waste of time.

What is the second parameter to sendSony() ?
Which Arduino board are you using ?

I'm using Arduino UNO

I don't have the code to write HEX to IR LED yet, I only tried this code, I tried this, but I know that is wrong

#include <IRremote.h>
IRsend irsend;

#define C_On  0xCFBC85E3  /*on*/
#define C_Off  0x3D074C55 /*off*/

int IRledPin = 13;

void setup()
{
  Serial.begin(9600);
  pinMode(IRledPin, OUTPUT);     
}

void loop() {
  //if (Serial.read() != -1) {
    for (int i = 0; i < 30; i++) {
      irsend.sendSony(C_On, 36); // Sony TV power code
      delay(2000);
      irsend.sendSony(C_Off, 36); // Sony TV power code
    }
  //}
}

.

void loop() {
  //if (Serial.read() != -1) {
    for (int i = 0; i < 30; i++) {
      irsend.sendSony(C_On, 36); // Sony TV power code
      delay(2000);
      irsend.sendSony(C_Off, 36); // Sony TV power code
    }
  //}
}

Shouldn't the nbits value be 32 for these codes? ie like this:

void loop() {
  //if (Serial.read() != -1) {
    for (int i = 0; i < 30; i++) {
      irsend.sendSony(C_On, 32); // Sony TV power code
      delay(2000);
      irsend.sendSony(C_Off, 32); // Sony TV power code
    }
  //}
}

But how to say to irsend class that I have connected the IR LED to the 13 pin?
i wonder if pinMode() instruction does that...

But how to say to irsend class that I have connected the IR LED to the 13 pin?

The IR LED MUST be connected to pin 3. Sending data requires modulating the IR LED, and that requires a timer. The timer is tied to the hardware - pin 3.

You can't use any old pin to SEND data. You can use any old pin to READ data.

I connect to pin3, the IR LED does not seems to emit any light (may be is too fast, my mobile phone camera does not detect it, but detects the light of original IR remote).

I took this code, c++ - How to correctly receive and send raw IR data from Arduino - Stack Overflow
with enhancements for RAWBUF

#define RAWBUF 400

it really helped me, to read 198 bytes of IR code from HITACHI remote to power on.

Then I wrote the next code to emit the right signal, but it didn't work.

#include <IRremote.h>

IRsend irsend;

unsigned int powerOn1[198] = {0x9,0x8,0x9,0x19,0x8,0x19,0x9,0x19,0x9,0x18,0x9,0x19,0x9,0x19,0x8,0x19,0x9,0x19,0x9,0x8,0x8,0x8,0x9,0x8,0x9,0x8,0x9,0x8,0x8,0x9,0x8,0x8,0x9,0x8,0x9,0x19,0x8,0x19,0x9,0x19,0x9,0x19,0x8,0x19,0x9,0x19,0x8,0x19,0x9,0x19,0x9,0x8,0x8,0x8,0x9,0x8,0x9,0x8,0x9,0x8,0x8,0x9,0x8,0x8,0x9,0x8,0x9,0x19,0x8,0x19,0x9,0x19,0x9,0x19,0x8,0x19,0x9,0x19,0x8,0x19,0x9,0x19,0x9,0x8,0x8,0x9,0x8,0x8,0x9,0x8,0x9,0x8,0x9,0x8,0x8,0x9,0x8,0x8,0x9,0x19,0x8,0x1A,0x8,0x19,0x9,0x19,0x8,0x19,0x9,0x19,0x8,0x19,0x9,0x19,0x9,0x8,0x8,0x9,0x8,0x8,0x9,0x8,0x9,0x8,0x9,0x8,0x8,0x9,0x8,0x8,0x9,0x19,0x9,0x19,0x8,0x19,0x9,0x19,0x8,0x19,0x9,0x19,0x8,0x1A,0x8,0x19,0x9,0x8,0x8,0x19,0x9,0x19,0x9,0x8,0x9,0x18,0x9,0x8,0x9,0x19,0x8,0x9,0x8,0x19,0x9,0x8,0x9,0x8,0x8,0x19,0x9,0x8,0x9,0x19,0x8,0x9,0x8,0x19,0x9,0x19,0x8,0x9,0x8,0x8,0x9,0x8,0x9,0x19,0x8,0x9,0x8,0x19,0x9,0x19,0x8,0x9,0x8};

void setup()
{
  pinMode(3, OUTPUT);
 Serial.begin(9600);
}

void loop() {
  int kHz = 0;
Serial.println("IRSendRaw go...");
     // altered the code just to send/test my raw code
       Serial.println("1");
       irsend.sendRaw(powerOn1,198,38);
       do{
                Serial.print("send khz = ");
                Serial.println(kHz);
       delay(1000);
       irsend.sendRaw(powerOn1,198,32);
       }while(kHz++ < 61);
       Serial.println("done");
       delay(5000);
}

I got this results:

IRSendRaw go...
1
send khz = 0
send khz = 1
send khz = 2
...
send khz = 29
send khz = 30
send khz = 31
send khz = 32
send khz = 33
send khz = 34
send khz = 35
send khz = 36
send khz = 37
send khz = 38
send khz = 39
send khz = 40
send khz = 41
...
send khz = 61
done

but no action with cooler. (IR LED connected to PIN 3)

i have made a test with IR LED (a simple digitalWrite(13, HIGH); to test it and see the light with mobile phone camera, it looks like nice violet color light.

photos of connections: Screenshot by Lightshot

IR Remote: Screenshot by Lightshot

NOTE: Potentiometer is configured to 200 Ohms to protect the IR LED. I also tryed to set it to 100 Ohms