Hi,
I’m currently using Mission Planner 1.3.77 build 1.3.8113.41594, ArduRover V4.2.0-beta2 (also tried on V4.1.5-stable), Pixhack 2.8.4 (a clone of Pixhawk).
I’ve enabled GPIO on AUX5 (SERVO13_FUNCTION=-1), RELAY_DEFAULT=0, RELAY_PIN=54, SCR_ENABLE=1.
I’m able to switch the RELAY0 between LOW and HIGH (checked with the voltmeter: there’s about 3.2V on HIGH), but when I toggle it, the pin goes HIGH for a moment and then goes LOW right after that.
I’ve tried to upload the LUA sample relay script ardupilot/relay_control.lua at master · ArduPilot/ardupilot · GitHub and a slightly modified version of it:
local RELAY_NUM = 0
function update() -- this is the loop which periodically runs
if relay:enabled(RELAY_NUM) then
gcs:send_text(2, 'Relay: Off')
relay:off(RELAY_NUM)
else
gcs:send_text(2, 'Relay: On')
relay:on(RELAY_NUM)
end
return update, 5000 -- reschedules the loop at 50Hz
end
return update() -- run immediately before starting to reschedule
They do not work as expected: the latter just prints “Relay: Off” all the time:
The 1st one is not togglilng the relay according to my voltmeter.
Any ideas what I’m doing wrong here?
Thanks in advance!