Skip to content

Commit 9c9c848

Browse files
authored
Implement Trim Pitch Roll for ACC
1 parent 700c8c3 commit 9c9c848

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

src/SCRIPTS/BF/PAGES/acc_trim.lua

Lines changed: 27 additions & 0 deletions
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+
}

0 commit comments

Comments
 (0)