// If only two positions don't set threshold at midrange. Setting to 0.25
// If only two positions don't set threshold at midrange. Setting to 0.25
// allows for this channel to work with either two or three position switch
// allows for this channel to work with either two or three position switch
varincrement=0.25
rc_offboard_th.value=0.25
varcurrentThreshold=0.0
inRedistribution=false
}
// Make sure we don't re-enter
if(loiterChannel!=0&&loiterChannel!=modeChannel){
inRedistribution=true
inRedistribution=true
currentThreshold+=increment
// If only two positions don't set threshold at midrange. Setting to 0.25
rc_loiter_th.value=currentThreshold
// allows for this channel to work with either two or three position switch
rc_loiter_th.value=0.25
inRedistribution=false
inRedistribution=false
}
}
if(posCtlChannel!=0&posCtlChannel!=modeChannel){
if(posCtlChannel!=0&posCtlChannel!=modeChannel){
// If only two positions don't set threshold at midrange. Setting to 0.25
// allows for this channel to work with either two or three position switch
varincrement=0.25
varcurrentThreshold=0.0
// Make sure we don't re-enter
inRedistribution=true
inRedistribution=true
currentThreshold+=increment
// If only two positions don't set threshold at midrange. Setting to 0.25
rc_posctl_th.value=currentThreshold
// allows for this channel to work with either two or three position switch
rc_posctl_th.value=0.25
inRedistribution=false
inRedistribution=false
}
}
}
}
Column{
Column{
...
@@ -389,9 +371,10 @@ Item {
...
@@ -389,9 +371,10 @@ Item {
QGCLabel{
QGCLabel{
width:parent.width
width:parent.width
text:"Flight Mode switches can be assigned to any channel which is not currently being used for attitude control. All channels are displayed below. "+
text:"The Main Mode, Loiter and PostCtl switches can be assigned to any channel which is not currently being used for attitude control. The Return and Offboard switches must be assigned to their seperate channel. "+
"You can drag Flight Modes from the Flight Modes section below to a channel and drop it there. You can also drag switches assigned to a channel "+
"All channels are displayed below. "+
"to another channel or back to the Unassigned Switches section. The Switch Display section at the very bottom will show you the results of your Flight Mode setup."
"You can drag Flight Modes from the Flight Modes section below to a channel and drop it there. You can also drag switches assigned to a channel "+
"to another channel or back to the Unassigned Switches section. The Switch Display section at the very bottom will show you the results of your Flight Mode setup."