--[[ ******************************** automatische Belichtungsreihe (c)msl Licence: GPL thx fudgey, mattkime, Mac, Atnes ******************************** @title Auto Bracketing @param a Ev Schritt 1/3 @default a 3 @param b Limit hell (29-1023) @default b 150 @param c Limit dunkel (29-1023) @default c 100 @param d Startverzögerung in s @default d 3 @param e Messung(0=mf,1=spot,2=cnt) @default e 2 @param f Schwellwert hell (0-100) @default f 82 @param g Schwellwert dunkel (0-100) @default g 92 ]] function log_name() log_path = "A/CHDK/LOGS/" log_file_name = "a_br" log_file_ending = ".log" log_name = log_path..log_file_name..log_file_ending logfile=io.open(log_name,"wb") io.output(logfile) end function log(...) io.write(...) io.write("\n") end function delay(sec) repeat cls() print("Start in ", sec, "Sekunden") sleep(960) sec = sec - 1 until sec==0 cls() end function get_measure_methode() if get_propset()==1 then mm = get_prop(9) else mm = get_prop(155) end return mm end function set_measure_methode(meme) if get_propset()==1 then set_prop(9,meme) else set_prop(155, meme) end end function fastshoot() press("shoot_half") repeat sleep(10) until get_shooting() == true press("shoot_full") release("shoot_full") release("shoot_half") repeat sleep(10) until get_shooting() ~= true pic_num = pic_num + 1 end function get_info() Bv=get_bv96() Av=get_av96() Sv=get_sv96() Tv=get_tv96() log("Bv=", Bv," Sv=",Sv, " Av=", Av, " Tv=",Tv) end function brighter(bright_tv) repeat bright_tv = bright_tv - ev_step set_tv96_direct(bright_tv) fastshoot() log("\nBild:", pic_num, "\t(längere Tv)") get_info() histo = get_histo_range(bright,1023) log("Schwellwert: ", th_bright, "\tHistogramm-Wert: ", histo) until histo > th_bright end function darker(dark_tv) repeat dark_tv = dark_tv + ev_step set_tv96_direct(dark_tv) fastshoot() log("\nBild:", pic_num, "\t(kürzere Tv)") get_info() histo = get_histo_range(0, dark) log("Schwellwert: ", th_dark, "\tHistogramm-Wert: ", histo) until histo > th_dark end function getImageDirs() local dcimList = os.listdir("A/DCIM", false) local i=1 if(dcimList) then table.sort(dcimList) end return dcimList end function restore() logfile:close() rename_log() shot_histo_enable(0) set_aflock(0) set_measure_methode(metering_is) end function rename_log() local log_num = 1 while os.stat(log_path..log_file_name..log_num..log_file_ending) do log_num = log_num + 1 end os.rename(log_name, log_path..log_file_name..log_num..log_file_ending) end --script start if a < 0 or a > 9 then a = 3 end if b < 29 or b > 1023 then b = 150 end if c < 29 or c > 1023 then c = 150 end if d < 0 or d > 10 then d = 3 end if e < 0 or e > 2 then e = 2 end if f < 0 or f > 100 then f = 85 end if g < 0 or g > 100 then g = 95 end ev_step = a * 32 bright = b dark = c delay_sec = d metering = e th_bright = f th_dark = g pic_num = 0 metering_is = get_measure_methode() set_measure_methode(metering) shot_histo_enable(1) if delay_sec > 0 then delay(delay_sec) end log_name() log("Auto HDR ", os.date("%d.%m.%Y %X\n")) log("") fastshoot() set_aflock(1) log("Bild:", pic_num, "\t(Referenzbild)") get_info() tv_start = Tv brighter(tv_start) darker(tv_start) print(pic_num, "Bilder gemacht.") print("fertig") restore()