Occasionally there is a 37-38 but I guess that is when it misses a pause.
What determine the time between pulses?
It might sound strange, but I have no idea. I will look into it once I have a little time.
Meanwhile: I have altered the code a little and ran a short test :
function pwm1(pwidth)
if( repeat_check("mode=2",pwidth ) >= PWM_required_repeats ) then
usb_shooting_mode = 2 -- request the next shot
end
end
function pwm2(pwidth)
if( repeat_check("mode=1",pwidth ) >= PWM_required_repeats ) then
usb_shooting_mode = 1 -- neutral position - do nothing
end
end
function pwm3(pwidth)
if( repeat_check("nothing",pwidth ) >= PWM_required_repeats ) then
--usb_shooting_mode = 1 -- set camera as waiting to shoot
end
end
function pwm4(pwidth)
repeat_check("shut down",pwidth)
shut_down()
-- = 0 -- put camera into playback / sleep mode
end
function pwm_mode() -- sample PWM code for Gentles gentwire-usb2 - note that values are in milliseconds
local pw = get_usb_power(2) * usb_precision
if pw > 0 then
if ((pw < 1) or (pw > 20)) then repeat_check("invalid pulse",pw)
elseif pw < 5 then pwm1(pw)
elseif pw < 10 then pwm2(pw)
elseif pw < 15 then pwm3(pw)
elseif pw < 20 then pwm4(pw)
elseif pw < 225 then repeat_check("idle pulse",pw)
end
end
end
I would like to ask you to use this in the next beta version.
I made a small test 130+ pictures were taken and I have a feeling that the PWM control worked.
there are also a few bugs in B9:
Log was not updated
Screen was not updated
Menu button did not finish the script running
Shoot button did not interrupt the script running
I would like to ask you to add precise time stamp both for the picture and the camera PWM. Least for the beta testing.
For Brainstorm: Pixhawk generates output continuously so Camera continuously gets PWM input.
If each input is considered as executable we will have a huge backlog pile-up. this might be a problem.
The idea of executing only the first and disregard subsequent identical shoot inputs within 0.55s (so far the minimum shot interval I have seen) seems necessary.
Unfortunately this cannot be the same for the pause(usb_shooting_mode = 1 ) as 0.6-0.7s shot interval should be usable.
I will do a car-test with this tomorrow with both B8 and B9 and B??(if available). :-)
Let me know if there are any specific scenarios that you would like me to test.
Many thanks in advance!