How to transmit 32 bits by IR signal to control helicopter

My project is control IR helicopter by arduino, i got the protocal from helicopter's controller (HERE : h

ttp://www.instructables.com/id/The-Easiest-Way-to-Use-Any-IR-Remote-with-Ardiuno/?ALLSTEPS

)

I dont know how to send the bit to helicopter because of some causes such as wait time, time led high or low. please help me and thank you very much.

Do you mean, from your post, that you already know exactly what to send to the Helicopter?

If so please give us an example so we can all be on the same page.

I think the most practial way to make progress is for you to make your best attempt at a sketch and then post it here with an explanation of its shortcomings (if any).

How do you propose to debug your code? (Something that needs to be planned in from the start - especially with anything complex.)

By the way, have you got the original IR controller for the helicopter and does it work?

...R

Thank you,this is my code, i transmit 32 bits but it didn't work, my helicopter same SM s107.

//Arduino code to control a helicotper.
int IRledPin =  12;    
int incomingByte = 0;
String incomingString;
int pulseValues[33];
int pulseLength = 0;

void setup()   {                
  // initialize the IR digital pin as an output:
  pinMode(IRledPin, OUTPUT);      
  pinMode(13, OUTPUT);   
  Serial.begin(9600);

  for (int i=0; i < 13; i++) 
    pulseValues[i] = 0;


}

void loop()                     
{
  SendCode();
}


void pulseIR(long microsecs) {
  cli();  // this turns off any background interrupts

  while (microsecs > 0) {
    // 38 kHz is about 13 microseconds high and 13 microseconds low
    digitalWrite(IRledPin, HIGH);  // this takes about 3 microseconds to happen
    delayMicroseconds(10);         // hang out for 10 microseconds
    digitalWrite(IRledPin, LOW);   // this also takes about 3 microseconds
    delayMicroseconds(10);         // hang out for 10 microseconds

    // so 26 microseconds altogether
    microsecs -= 26;

  }

  sei();  // this turns them back on
}

void Zero()
{  
  pulseIR(300);
  delayMicroseconds(300);
  pulseLength += 600;
}

void One()
{
  pulseIR(300);
  delayMicroseconds(600); 
  pulseLength += 900;
}

void sendPulseValue(int pulseValue)
{
  if (pulseValue == 1)
    One();
  else
    Zero(); 
}

void checkPulseChanges()
{
 
 
      pulseValues[0] = 1;
      pulseValues[1] = 1;
      pulseValues[2] = 0;
      pulseValues[3] = 1;
      pulseValues[4] = 0;
      pulseValues[5] = 0;
      pulseValues[6] = 0;
      pulseValues[7] = 0;
      
      pulseValues[8] = 0;
      pulseValues[9] = 1;
      pulseValues[10] = 0;
      pulseValues[11] = 0;
      pulseValues[12] = 0;
      pulseValues[13] = 1;
      pulseValues[14] = 0;
      pulseValues[15] = 0;
      
      pulseValues[16] = 0;
      pulseValues[17] = 0;
      pulseValues[18] = 0;
      pulseValues[19] = 0;
      pulseValues[20] = 0;
      pulseValues[21] = 0;
      pulseValues[22] = 1;
      pulseValues[23] = 1;
      
      pulseValues[24] = 0;
      pulseValues[25] = 0;
      pulseValues[26] = 1;
      pulseValues[27] = 0;
      pulseValues[28] = 0;
      pulseValues[29] = 0;
      pulseValues[30] = 1;
      pulseValues[31] = 1;
      
      

        
  }



void SendCode() {

 
  checkPulseChanges();

  pulseIR(4000);
  delayMicroseconds(2000);
    pulseLength=6000;

    sendPulseValue(pulseValues[0]);
    sendPulseValue(pulseValues[1]);
    sendPulseValue(pulseValues[2]);
    sendPulseValue(pulseValues[3]);
    sendPulseValue(pulseValues[4]);
    sendPulseValue(pulseValues[5]);
    sendPulseValue(pulseValues[6]);
    sendPulseValue(pulseValues[7]);
    sendPulseValue(pulseValues[8]);
    sendPulseValue(pulseValues[9]);
    sendPulseValue(pulseValues[10]);
    sendPulseValue(pulseValues[11]);
    sendPulseValue(pulseValues[12]);
    sendPulseValue(pulseValues[13]);
    sendPulseValue(pulseValues[14]);
    sendPulseValue(pulseValues[15]);
    sendPulseValue(pulseValues[16]);
    sendPulseValue(pulseValues[17]);
    sendPulseValue(pulseValues[18]);
    sendPulseValue(pulseValues[19]);
    sendPulseValue(pulseValues[20]);
    sendPulseValue(pulseValues[21]);
    sendPulseValue(pulseValues[22]);
    sendPulseValue(pulseValues[23]);
    sendPulseValue(pulseValues[24]);
    sendPulseValue(pulseValues[25]);
    sendPulseValue(pulseValues[26]);,
    sendPulseValue(pulseValues[27]);
    sendPulseValue(pulseValues[28]);
    sendPulseValue(pulseValues[29]);
    sendPulseValue(pulseValues[30]);
   //sendPulseValue(pulseValues[31]);

    //Footer
    pulseIR(360); 
    delayMicroseconds( (28600 - pulseLength) ); 
    
}

I asked 5 questions and you only answered part of one of them. When you answer all the questions I will think about your problem some more. I can't read your mind.

...R