Ravi_K
(Ravi K)
May 1, 2020, 6:12am
1
Guys I want to change Q_tilt_mask with a aux switch so that I have a control on motors to tilt in forward flight mode with aux switch
iampete
(Peter Hall)
May 1, 2020, 11:14am
2
This is not currently possible in the main code, but you could do it with scripting.
Ravi_K
(Ravi K)
May 1, 2020, 11:17am
3
How can I do,can you elaborate I am new to script.
iampete
(Peter Hall)
May 1, 2020, 11:21am
4
The wiki page on scripting,
https://ardupilot.org/plane/docs/common-lua-scripts.html
This is a example of changing params with sctipting,
-- This script is a test of param set and get
local count = 0
function update() -- this is the loop which periodically runs
-- get and print all the scripting parameters
local value = param:get('SCR_ENABLE')
if value then
gcs:send_text(6, string.format('LUA: SCR_ENABLE: %i',value))
else
gcs:send_text(6, 'LUA: get SCR_ENABLE failed')
end
value = param:get('SCR_VM_I_COUNT')
if value then
gcs:send_text(6, string.format('LUA: SCR_VM_I_COUNT: %i',value))
else
gcs:send_text(6, 'LUA: get SCR_VM_I_COUNT failed')
end
value = param:get('SCR_HEAP_SIZE')
if value then
This file has been truncated. show original
This is a example of reading in rc inputs,
-- example of getting RC input
function update()
pwm1 = rc:get_pwm(1)
pwm2 = rc:get_pwm(2)
pwm3 = rc:get_pwm(3)
pwm4 = rc:get_pwm(4)
gcs:send_text(0, "RCIN 1:" .. tostring(pwm1) .. " 2:" .. tostring(pwm2).. " 3:" .. tostring(pwm3).. " 4:" .. tostring(pwm4))
return update, 1000 -- reschedules the loop
end
return update()
Should be quite easy to combine to change param values on a switch input.
Ravi_K
(Ravi K)
May 1, 2020, 11:25am
5
Thanks for the info peter .problem is I don’t know coding.is it possible for you to right ,I think it will not take mutch time if coding is know
Ravi_K
(Ravi K)
May 1, 2020, 11:51am
6
If aux switch in put is low (ppm less than 1200)q_tilt_mask should be 8,if switch is at middle (ppm 1400-1600) q_tilt_mask should be 3 and at high (ppm great than 1800) q_tilt_mask should be 11.