Hi again,
I followed your advices and get it working! Thank you very much!
Now I'm trying to get a display saying "Taking picture 2 of 20" and so on. The text generator itself already works. The problem is the script is designed to take pics on "silent mode" with LV on.
I tried printing it in the console, pause de Live View before it, showing it with a notify_box... You'll see in the code I have a big mess about it:
mymenu = menu.new
{
name = "Astrophoto",
help = "Takes several photos to complete BIAS, DARK, LIGHT and FLAT sequences, for astrophotografy",
submenu =
{
{
name = "Start!",
help = "Run this script.",
select = function(this) task.create(astro) end,
},
{
name = "How many LIGHT photos?",
help = "DARK, BIAS and FLAT will be the same",
min = 0,
max = 30,
value = 2
}
}
}
--mymenu.submenu["Start!"].select = function(this) task.create(astro) end,
function astro()
local n = mymenu.submenu["How many LIGHT photos?"].value
menu.close()
console.show()
-- warnings
if camera.mode ~= MODE.M then
print("Enable MANUAL mode and run again")
key.wait()
return
end
console.clear()
print("BIAS and DARK initial sequences (10+10 photos)".."\n".."Select in MANUAL mode prefered iso/aperture/speed and ".."\n".."cover the objetive with the cap".."\n".."\n".."Press any key to start")
key.wait()
console.clear()
-- Declare local variables to keep camera configuration at the start and use it
local a = camera.aperture.value
local i = camera.iso.value
local s = camera.shutter.value
print("Starting the sequence with this configuration:")
print("\n")
print ("Aperture = "..tostring(a))
print ("ISO = "..tostring(i))
print ("Speed = "..tostring(s))
print("\n")
print("\n")
print("You are going to take "..tostring(6*n).." pictures")
print("Silent mode is recomended for this script")
print("\n")
print("\n")
print("Press any key to continue")
key.wait()
console.clear()
console.hide()
-- BIAS sequence
camera.aperture.value = a
camera.iso.value = i
camera.shutter.value = 1/4000
local r = 0
while r < n do
console.hide()
lv.start()
camera.shoot()
r = r+1
lv.pause()
console.show()
msleep(100)
display.notify_box("Initial BIAS "..tostring(r).." of "..tostring(n).."\n"..
"Initial DARK 0 of"..tostring(n).."\n"..
"LIGHT 0 of "..tostring(n).."\n"..
"Final DARK 0 of "..tostring(n).."\n"..
"Final BIAS 0 of "..tostring(n).."\n"..
"Final FLAT 0 of "..tostring(n).."\n"..
"TOTAL "..tostring(r).." of "..tostring(6*n),3000)
msleep(100)
end
-- DARK sequence
camera.aperture.value = a
camera.iso.value = i
camera.shutter.value = s
console.clear()
local r = 0
while r < n do
console.hide()
lv.start()
camera.shoot()
r = r+1
lv.pause()
console.show()
msleep(100)
display.notify_box("Initial BIAS done!".."\n"..
"Initial DARK "..tostring(r).." of "..tostring(n).."\n"..
"LIGHT 0 of "..tostring(n).."\n"..
"Final DARK 0 of "..tostring(n).."\n"..
"Final BIAS 0 of "..tostring(n).."\n"..
"Final FLAT 0 of "..tostring(n).."\n"..
"TOTAL "..tostring(n+r).." of "..tostring(6*n),3000)
msleep(100)
end
-- LIGHT sequence
lv.pause()
console.clear()
console.show()
print("LIGHT sequence (10 photos)","\n","Uncover the objetive","\n","\n","Press half shutter to start")
key.wait()
console.clear()
console.hide()
camera.aperture.value = a
camera.iso.value = i
camera.shutter.value = s
local r = 0
while r < n do
console.hide()
lv.start()
camera.shoot()
r = r+1
lv.pause()
console.show()
msleep(100)
display.notify_box("Initial BIAS done!".."\n"..
"Initial DARK done!".."\n"..
"LIGHT "..tostring(r).." of "..tostring(n).."\n"..
"Final DARK 0 of "..tostring(n).."\n"..
"Final BIAS 0 of "..tostring(n).."\n"..
"Final FLAT 0 of "..tostring(n).."\n"..
"TOTAL "..tostring(2*n+r).." of "..tostring(6*n),3000)
msleep(100)
end
lv.stop()
console.clear()
console.show()
print("Press any key to end")
key.wait()
console.clear()
console.hide()
end
(It's a long code, but just to show I'm lost about the display function)
What is a good way of showing the progress when taking pictures in "silent mode"? Print to console, notify box, stop the Live View before...?
Thanks again, the drill works!