Here's another script that is oh-so close. The idea is to switch between two series of settings while shooting and toggle this 'mode' with the joystick. The logic seems sound and it all works perfectly when the camera.shoot() statements are commented out and I just watch the camera settings change. When the camera.shoot() statements are included, it still works in principle but several shots are fired off before the key event is handled. This is very frustrating, as I would guess that the ability to handle key inputs would increase with longer task.yield() periods, yet this is not what I see for reasonable values of task.yield(). Any ideas?
For those of you who are LUA experts: Apologies for my mistreatment of the LUA language
For those of you who are LUA experts: Apologies for my mistreatment of the LUA language
Quoterequire('keys')
menu.new
{
name = "MultiSeq",
select = function() task.create(multiseq) end,
depends_on = DEPENDS_ON.M_MODE,
}
multiseq = function()
shutters0 = { 1/4 , 1/8, 1/16 }
apertures0 = { 8.0 , 5.6, 4.0 }
isos0 = { 100 , 100, 100 }
shutters1 = { 1/32 , 1/64, 1/128 }
apertures1 = { 16.0 , 11.0, 8.0 }
isos1 = { 200 , 200, 200 }
elementsin0 = 3
elementsin1 = 3
seq = 0
k = nil
i = 1
keys:start()
beep(1,500)
while true do
if seq == 0 then
camera.shutter.value = shutters0
camera.aperture.value = apertures0
--camera.iso.value = isos0
camera.shoot()
i = i+1
if i>elementsin0 then
i = 1
end
elseif seq == 1 then
camera.shutter.value = shutters1
camera.aperture.value = apertures1
--camera.iso.value = isos1
camera.shoot()
i = i+1
if i>elementsin1 then
i = 1
end
else
keys:stop()
return
end
task.yield(1000)
k = keys:getkey()
if k==KEY.LEFT or k==KEY.RIGHT then
if (seq == 0) then
seq = 1
beep(2)
else
seq = 0
beep(1)
end
i = 1
elseif k==KEY.SET or k==KEY.UP or k==KEY.DOWN then
seq = 2
beep(1, 1000)
end
end
end