-
-
Notifications
You must be signed in to change notification settings - Fork 155
Trim acc #457
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Trim acc #457
Changes from 2 commits
21ead4f
e808f95
1535b18
a8d0765
3383fd7
b19b6a6
1a9b57f
d131e74
d25763d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,30 @@ | ||||||
|
|
||||||
| local template = assert(loadScript(radio.template))() | ||||||
| local margin = template.margin | ||||||
| local indent = template.indent | ||||||
| local lineSpacing = template.lineSpacing | ||||||
| local tableSpacing = template.tableSpacing | ||||||
| local sp = template.listSpacing.field | ||||||
| local yMinLim = radio.yMinLimit | ||||||
| local x = margin | ||||||
| local y = yMinLim - lineSpacing | ||||||
| local inc = { x = function(val) x = x + val return x end, y = function(val) y = y + val return y end } | ||||||
| local labels = {} | ||||||
| local fields = {} | ||||||
|
|
||||||
| if apiVersion >= 1.041 then | ||||||
|
||||||
| if apiVersion >= 1.041 then | |
| if apiVersion >= 1.16 then |
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Too much indent.
The field text could also be just "Pitch" and "Roll" since the "Trim Accelerometer" header explains it all. These should also be indented. "x = x + indent" for both of these. Look at the other pages to see how we usually do it.
This won't work as it should. both pitch and roll trim are 16 bit values so for pitch it should be "vals = { 1, 2 }" and for roll "vals = { 3, 4 }". Have a look at the MSP_ACC_TRIM" message in the BF source code. 🙂
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is a reboot needed for the trim to take effect?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know if it's needed. How can I test this?
Thx for all the other informations it's my fist commit,didnt know all the thinks only test it and it works 😉.
What happens if I do Wirte only 1 instead of 1, 2 due to 16 bit?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"reboot = false". Then try making some changes, save the page and see if it took effect 🙂
What happens is that the pitch field will modify the first byte of pitch trim and the roll field will modify the second byte of pitch trim. So the roll field will make unintended changes to pitch trim, and you won't be able to change roll trim at all
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For this message we need at least 4 bytes to be able to do anything.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -56,4 +56,8 @@ if apiVersion >= 1.41 then | |
| PageFiles[#PageFiles + 1] = { title = "GPS PIDs", script = "gpspids.lua" } | ||
| end | ||
|
|
||
| if apiVersion >= 1.16 then | ||
| PageFiles[#PageFiles + 1] = { title = "Trim Accelerometer", script = "acc_calibrate.lua" } | ||
|
||
| end | ||
|
|
||
| return PageFiles | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't want this