I did some comments in my script and I am posting it as a file.
Before you try to solve my problem I would like to shortly explain for what I am am using it for,
so you can visualize it and maybe understand what I am trying to achieve.
I am competing in free-flight modelcompetitions.
These airplane models are not radio-controlled.
They are flight preset.
They are towed in air by 50 meter slimrope. The rope is attached on a hook.
When I have it in the air attached on a hook, I can go around with it and search for a thermal air.
And when I feel that plane is pulling me up, I can detach the rope and the plane starts to fly.
On competition it is the time of flight that counts. A timekeeper is measuring time till the plane touches
ground or reaches a maximum of 180 seconds of flight (might very).
Because the plane flies by itself, it goes in the wind direction.
Sometimes (in the strong wind) it goes a few kilometers. To be able to see it so far, I have installed an LED.
If it goes away to far, then I have to
search for it. Sometimes a plane lands somewhere for example in the
cornfields and is hard to find.
But when I am near it, I can search for it with RC button (with it, I can also end a flight if the plane
goes towards the trees for example)
And here is my problem:
In my script I am trying to achieve that servos and LED are working indepentently.
LED blinks every 3000 milliseconds for 50 milliseconds during the flight of the plane
and servos are working with delays. These delays are set in the BUNT and FLIGHT subroutines.
Maybe I place the wrong place to call an led-blink-flight subroutine. Even if I remove a call for this
subroutine and leave the other two (you will see in the script), it is still not delaying servos as it should.
Then the delays are slower for a lesser factor which is better but also not good.
Sorry for the long introduction, but it maybe helps you to find a problem and solution.
Also, I might have used some wrong terms in this post because we don't speak English where I live.
Thanks and have fun because I already gave up.
FREE FLIGHT - F1A.txt (8.6 KB)