Skip to content

Commit 378ba2f

Browse files
authored
Merge pull request #459 from druckgott/trim_acc2
Trim acc2
2 parents 700c8c3 + a2165ac commit 378ba2f

File tree

2 files changed

+31
-0
lines changed

2 files changed

+31
-0
lines changed

src/SCRIPTS/BF/PAGES/acc_trim.lua

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
local template = assert(loadScript(radio.template))()
2+
local margin = template.margin
3+
local indent = template.indent
4+
local lineSpacing = template.lineSpacing
5+
local tableSpacing = template.tableSpacing
6+
local sp = template.listSpacing.field
7+
local yMinLim = radio.yMinLimit
8+
local x = margin
9+
local y = yMinLim - lineSpacing
10+
local inc = { x = function(val) x = x + val return x end, y = function(val) y = y + val return y end }
11+
local labels = {}
12+
local fields = {}
13+
14+
labels[#labels + 1] = { t = "Trim Accelerometer", x = x, y = inc.y(lineSpacing) }
15+
fields[#fields + 1] = { t = "Pitch", x = x + indent, y = inc.y(lineSpacing), sp = x + sp, min = -300, max = 300, vals = { 1, 2 } }
16+
fields[#fields + 1] = { t = "Roll", x = x + indent, y = inc.y(lineSpacing), sp = x + sp, min = -300, max = 300, vals = { 3, 4 } }
17+
18+
return {
19+
read = 240, -- MSP_ACC_TRIM
20+
write = 239, -- MSP_SET_ACC_TRIM
21+
title = "Acc",
22+
reboot = false,
23+
eepromWrite = true,
24+
minBytes = 4,
25+
labels = labels,
26+
fields = fields,
27+
}

src/SCRIPTS/BF/pages.lua

+4
Original file line numberDiff line numberDiff line change
@@ -56,4 +56,8 @@ if apiVersion >= 1.41 then
5656
PageFiles[#PageFiles + 1] = { title = "GPS PIDs", script = "gpspids.lua" }
5757
end
5858

59+
if apiVersion >= 1.16 then
60+
PageFiles[#PageFiles + 1] = { title = "Trim Accelerometer", script = "acc_trim.lua" }
61+
end
62+
5963
return PageFiles

0 commit comments

Comments
 (0)