I'm still pretty new to all this, so firstly, let me say thank you to all those that have helped me get my head around quads and setting up my X 525.
I have a quite frustrating problem..
I want to program what is effectively, " trainer wheels " for my drone in the form of an auto minimum altitude hold using an Arduino board, and an Ultrasonic detector as a "sensor" that will work along with my KK board.
With the Ultrasonic facing downwards, and a sketch including at a pre-determined height ( above 4 feet for example ) there will be no ground detection.
The usual state will be a "low" and the Arduino would do nothing but loop through the sketch looking for this Ultrasonic trigger.
However, - when the ultrasonic DOES trigger, the Arduino should sense a "high state". - When this happens it should ( fuzzy logic here ok? ) be able to detect the CURRENT throttle setting via the radio receiver and prevent any throttle range below it. - ( and yes, this feature would be on a switch on the RC transmitter lol! ).
Obviously, if the Ultrasonic detection is not made, ( switched off ) then its full range as usual.
Where the Servo comes in, is that it will be my throttle servo currently linked to the KK board via the receiver.
Like I said, I'm new to Arduino programming, and I'm still getting my head around things like GOTO statements are not generally permitted.so I'm having a hard time figuring out the finer points of conditional statements, if then, gosub, ( etc )
If you have any ideas, please let me know.
I've only been learning Arduino programming foe a day so far but this is a little harder than making an LED blink.
P.S. - for the record, I DID manage to learn enough to make that LED blink S.O.S. in Morse. Code in a loop.