Merge pull request #962 from McGiverGim/bf-fix_msp_controls

Fix MSP controls
10.3.x-maintenance
Michael Keller 2018-03-04 00:49:28 +13:00 committed by GitHub
commit cd04c1e6f3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 18 additions and 18 deletions

View File

@ -7,26 +7,26 @@ var
// What's the index of each channel in the MSP channel list?
channelMSPIndexes = {
roll: 0,
pitch: 1,
throttle: 2,
yaw: 3,
aux1: 4,
aux2: 5,
aux3: 6,
aux4: 7,
Roll: 0,
Pitch: 1,
Throttle: 2,
Yaw: 3,
Aux1: 4,
Aux2: 5,
Aux3: 6,
Aux4: 7,
},
// Set reasonable initial stick positions (Mode 2)
stickValues = {
throttle: CHANNEL_MIN_VALUE,
pitch: CHANNEL_MID_VALUE,
roll: CHANNEL_MID_VALUE,
yaw: CHANNEL_MID_VALUE,
aux1: CHANNEL_MIN_VALUE,
aux2: CHANNEL_MIN_VALUE,
aux3: CHANNEL_MIN_VALUE,
aux4: CHANNEL_MIN_VALUE
Throttle: CHANNEL_MIN_VALUE,
Pitch: CHANNEL_MID_VALUE,
Roll: CHANNEL_MID_VALUE,
Yaw: CHANNEL_MID_VALUE,
Aux1: CHANNEL_MIN_VALUE,
Aux2: CHANNEL_MIN_VALUE,
Aux3: CHANNEL_MIN_VALUE,
Aux4: CHANNEL_MIN_VALUE
},
// First the vertical axis, then the horizontal:
@ -160,7 +160,7 @@ $(document).ready(function() {
$(".slider", sliderElems).each(function(sliderIndex) {
var
initialValue = stickValues["aux" + (sliderIndex + 1)];
initialValue = stickValues["Aux" + (sliderIndex + 1)];
$(this)
.noUiSlider({
@ -172,7 +172,7 @@ $(document).ready(function() {
}).on('slide change set', function(e, value) {
value = Math.round(parseFloat(value));
stickValues["aux" + (sliderIndex + 1)] = value;
stickValues["Aux" + (sliderIndex + 1)] = value;
$(".tooltip", this).text(value);
});