How to arm a kk2 quadcopter with UNO

Im building a quad copter with a kk2.15 mini flight controller that is connected with UNO, when i upload the code the kk2 screen say error :now yaw input and no thro input
this is the code im uploading

#include <Servo.h>


 Servo Throttle;
 Servo Rudder;
 Servo Aileron;
 Servo Elevator;
 Servo Auxiliary;
  
  
void setup() {

  Throttle.attach(5);
  Rudder.attach(10);
  Aileron.attach(6);
  Elevator.attach(9);
  Auxiliary.attach(11);
  
}

void loop() {
    
  Throttle.writeMicroseconds(1200);
  Rudder.writeMicroseconds(0);
  delay(4000);
}

please note that im a beginner

this is is the quad : (not very sure of the way i connected it)
1914575_1688027401454111_8710193072700928479_n.jpg

Putting your servo definitions in setup is very limiting, isn't it?

when i just define thw servos inside setup and then trying to use them inside loop it said they r undefined in loop scope … like this code

#include <Servo.h>

void setup() {

  Servo Throttle;
  Servo Rudder;
  Servo Aileron;
  Servo Elevator;
  Servo Auxiliary;
}

void loop() {

  Throttle.attach(5);
  Rudder.attach(10);
  Aileron.attach(6);
  Elevator.attach(9);
  Auxiliary.attach(11);
  
  Throttle.write(180);
  Rudder.write(0);
  Throttle.writeMicroseconds(1200);
  Rudder.writeMicroseconds(2000);
  delay(4000);

}

i found an example here in learning section do all the stuff inside the setup scope … maybe it was just set to done once … anyway do u suggest anything ?!

Duplicator_MoH:
when i just define thw servos inside setup and then trying to use them inside loop it said they r undefined in loop scope … like this code

#include <Servo.h>

  Servo Throttle;
  Servo Rudder;
  Servo Aileron;
  Servo Elevator;
  Servo Auxiliary;

void setup() {


}

Put them there and they’re global scope. Then they will be declared everywhere and you won’t get that error.

Are you making progress on this Duplicator_MoH?

Please don't treat forum posts like text messages. "r", "u" and "i" are not words.

Were you able to get the KK board programmed?

It's not clear if you're trying to program the Uno or the KK board.

hay DuaneDegn , next time I will write them carefuly my friend :slight_smile:

im trying to programming the kk board , arm it and then give it throttle to fly .... which still not working

next time I will write them carefuly

im trying

But not this time.

Programming requires precise use of grammar, syntax and spelling so it always worries me that users can be so sloppy when posting to the forum.

UKHeliBob:
But not this time.

Apparently I’m not the only one to notice.

I will get TOEFL in two days I promise !!
let us focus on the matter of this forum please.

let us focus on the matter of this forum please.

Let’s do that.
Have you now declared your servos as global objects as suggested ?

yes i do … this is the code im using now :

#include <Servo.h>


 Servo Throttle;
 Servo Rudder;
 Servo Aileron;
 Servo Elevator;
 Servo Auxiliary;
  
  
void setup() {

  Throttle.attach(5);
  Rudder.attach(10);
  Aileron.attach(6);
  Elevator.attach(9);
  Auxiliary.attach(11);
  
}

void loop() {
    
  Throttle.writeMicroseconds(1200);
  Rudder.writeMicroseconds(0);
  delay(4000);
}

Duplicator_MoH:
yes i do … this is the code im using now :

#include <Servo.h>

Servo Throttle;
Servo Rudder;
Servo Aileron;
Servo Elevator;
Servo Auxiliary;
 
 
void setup() {

Throttle.attach(5);
  Rudder.attach(10);
  Aileron.attach(6);
  Elevator.attach(9);
  Auxiliary.attach(11);
 
}

void loop() {
   
  Throttle.writeMicroseconds(1200);
  Rudder.writeMicroseconds(0);
  delay(4000);
}

…and?

Sorry for not completing the post ... the kk board it gives me those errors , no yaw input and then no thro input (tow errors together) ...

Have the Uno and the KK got a common GND connection ?

The GND of the KK is connected to the GND of the Uno as showen , there is a pin after the GND pin on the kk board called U+ i think its for sensors so u see that i dont plugged it , the after pins are by order : throttle , Ali , ELE , RUD , AUX
1914575_1688027401454111_8710193072700928479_n.jpg

Like most photographs posted here it is very difficult to see exactly what is connected to what. Can you please provide a drawing of the circuit even if simply hand drawn and photographed.

Does the KK2 work when connected to the RC receiver ? What happens if you connect a servo to the Arduino outputs ? You should really use an external power supply when trying this.

I didn't buy a receiver , but I try simple examples on Uno and it did work good.
the arduino is powered by USB that is connected to the computer , and the kk2 board is connect to a 5000 mAh lipo battery , NOTE : when i upload a sketch to the arduino the kk2 board respond and power on even if it isn't connected to the lipo , I mean it did receive power and things from the arduino.
this is the circuit (hand drawn):

this is the circuit

Did you forget something ?

The internet is lagging and didn't accept to upload the photo but it did go well for the post !

And it still gives me the two errors - no yaw input (yaw is for rudder)
and no thro input mean throttle !