Rc control:start motor only if servo is in position

Hello guys, I am new to arduino programming, I am starting to learn the theory at the moment, while waiting for my arduino to arrive.

I would like to have a few tips on how to do what I explain in the title.

I would like to control the rc motor and servos with arduino micro or nano.
In theory what I intent to do is, if the servo is in a determined position, the motor won't start even if I push the throttle stick all up. And when the servo is in other position if I push the throttle stick the motor will start.

Both servos and motor a will be controlled via rc with the help of his tutorial:

https://www.sparkfun.com/tutorials/348

If you guys can share a light (or a code) on this I would appreciate.

Thanks in advance.

Sounds like the 'arming' sequence of a typical quadcopter. Perhaps a look at the ArduCopter sources will give hints as to how it might be done:

http://code.google.com/p/arducopter/

Do you want the motor to start anytime after you have instructed to servo to move to the required position or do you only want the motor to start when the servo is actually in position.

If the latter is what you want you will need to add some sort of detector "switch" that is set by the servo and then your sketch would only start the motor if the switch is "on".

...R

Thanks, all.
Shaft i intent to do is, if servo is in positivos y, the motores Will not start no matter what I do to the button or the stick.
If the servo is in position x the motor can start with a click of a button or stick.

Is this well explained?
Sorry for my poor English.

I am waiting for an arduino and a apm2.5.
But the apm 2.5 is too much expensive for the project, as soon as it arrives I will install it to my rc crawler lol.

What I was thinking was a kk board or some clone, and a servo/motor controller to control the arming of the motor.

Maybe something using a if statement, instructing motor only if the servo is in the x position.

Imagine that I have 2 rc retracts (they work like servos) and if they are deployed the motor will run, but if they are retracted the motor won't start.

What you're describing isn't possible with a servo alone. While you can command a servo to move to a certain position you never know for sure if it is in that position -- there is no feedback. Well, you can make a guess based on how much power the servo is consuming (a servo consumes more power when it's trying to move rather than when it's stationary) but that's not very easy to implement.

You need some other way of determining if your retracts are up/down; probably a small lever microswitch would work best.

Chagrin, i will e using a HobbyKing Multi-Rotor Control Board V2.1 (Atmega168PA) control board, and that Microswitch lever might be a great addon.

Scenario 1: 2x Microswitch Lever connected to the Control Board
Scenario 2: 2x Microswitch Lever connected to Arduino mini (or nano) wich is connected to the control board.

Anyone can help here?

Edit: Nevermind, i figured it out, the microswitch dos the signal cutting it self.
Chagrin i think this is the best way to do it. Thanks

It will be something link this image explains:
http://www.ukrcrc.com/gallery/albums/userpics/OCMDigWiring~0.jpg

You'd need a triple pole switch (maybe just double?) rated ~30A to do that. Brushless motors have three leads, don't forget. It would also be impossible to put the retracts up while flying.

Sorry I'm not being very helpful here; While I'm familiar with these KK boards I can't think of any simple ways to implement what you're asking. Is it worth mentioning that these boards already have an arming sequence (requires the throttle at zero and rudder full right to arm)?

Hello, i have ordered a few Micro switch levers, to test, i will post here a test of the all thing.

They are very cheap
i will be using esc for brushless motors, and if using this microswitchs i will not need to do nothing to the HK board.
They will cut the signal if deployed and if retracted the motors will start.