Hi! Maybe somebody can help me understand and fix my problem: the idea is to create a script that will do one move forward with servo after every click to rc10 button. Here is my script and it absolutely not work like that: local SERVO_FUNCTION = 94
local MOVE_AMOUNT = 100
local POSITION = 1500 – Середнє положення
local is_moving = false
function update()
local RC10 = rc:get_pwm(10)
if RC10 > 1500 then
is_moving = true
else
is_moving = false
end
if is_moving then
POSITION = POSITION + MOVE_AMOUNT
SRV_Channels:set_output_pwm(SERVO_FUNCTION, POSITION)
end
return update, 20 – reschedules the loop at 50Hz
end
return update()