While developing the startup system for the Q400, I encountered a problem I don't understand:
This is my code, it runs in a loop along with other systems, no output/failures are displayed in the log window.
- Code: Select all
if(getprop("/controls/engines/engine/ignition-switch") == 1 and getprop("/systems/electrical/volts") > 25){
setprop("controls/engines/engine/ignition", 1);
}
if(getprop("/controls/engines/engine/ignition-switch") == 0 or getprop("/systems/electrical/volts") < 25){
setprop("controls/engines/engine/ignition", 0);
}
if(getprop("/controls/engines/engine[1]/ignition-switch") == 1 and getprop("/systems/electrical/volts") == 25){
setprop("controls/engines/engine[1]/ignition", 1);
}else{
setprop("controls/engines/engine[1]/ignition", 0);
}
The problem is, that while the ../ignition-switch is at 1 and the ../volts are constantly at 28, the ../ignition flatters from 0 to 1 some times per second.
Has anybody an idea what could be the problem?