--[[Author: Andrew baisleyHeavily based on Fraser McCrossan's 'Accurate Intervalometer with power-saving and pre-focus'Many, many thanksTested on A460, should work on most cameras.An accurate intervalometer script designed for shooting road trips.Features:* focus fixed at infinity* power saving* endless loop until power or memory fail* occasional light reading.--]]--[[@title Cycle Lapse@param s Secs per frame@default s 10@param m Mins per light reading@default m 10@param b Min battery voltage in mV@default b 2150@param d Min space on card in Kb@default d 200--]]-- convert parameters into readable variable namessecs_frame, mins_per_reading, min_vbatt, min_space = s, m, b, d * 1024props = require "propcase"-- if the display mode is not the passed mode, click display and return true-- otherwise return falsefunction seek_display_mode(mode) if get_prop(props.DISPLAY_MODE) == mode then return false else click "display" return true endend-- switch to autofocus mode, focus on infinity, then go to manual focus modefunction light_reading() set_aflock(0) press("shoot_half") sleep(2000) set_focus(65535) set_aflock(1) release("shoot_half") sleep(500)end-- switch off display, setting 2while seek_display_mode(2) do sleep(1000)endlight_reading()start_ticks = get_tick_count()ticks_per_frame = 1000 * secs_frameframes_per_meter = mins_per_reading * 60 / secs_frameframe = 1-- shoot until battery or card failswhile get_vbatt() >= min_vbatt and get_free_disk_space() >= min_space do shoot() set_backlight(0) if frame % frames_per_meter == 0 then light_reading() end sleep( start_ticks + frame * ticks_per_frame - get_tick_count() ) frame = frame + 1end-- backlight onset_backlight(1)-- display on, setting = 0while seek_display_mode(0) do sleep(1000)end-- print warning messagesif get_vbatt < min_vbatt then print("** CHANGE BATTERY **") endif get_free_disk_space < min_space then print("++ CHANGE MEMORY CARD ++") end-- restore focus modeset_aflock(0)-- sound alarmplay_sound(7)
Did a quick test and it feels nice.But I get one error after ~35 min of shooting @ 5 sec interval::85: attempt to compare function with numberPRESS SHUTTER TO CLOSEWhat can this mean.I could repeat the procedure and get the error again.I have 198MB of memory left and 30% battery.I'm using a Ixus60 camera.
--[[@title Cycled Video intervalometer@param b video length in seconds @default b 300@param v buffer wait time in 1/1000sec@default v 4000@param c number of videos, >2 @default c 4@param p print log (1==enabled)@default p 0@param k delete all files from SD@default k 0--]] --[[ Req: just free SD card, Canon S3 camera, Predfined shooting parameters in chosen mode No photos or other files in DCIM - they will be killed Only current CANONxxx folder in DCIM allowed (it can be deleted by "Erase all" or CHDK File Browser) if script fails or jamm, try to increase buffer wait time mailto: wild_creator@inbox.ru--]]a=1if k==1 then dir = os.listdir("A/DCIM", false) count = table.getn(dir) for i=1,count do dirr = os.listdir("A/DCIM/"..dir[i], false) [admin: avoid swearing please] = table.getn(dirr) for j=1,[admin: avoid swearing please] do s="A/DCIM/"..dir[i].."/"..dirr[j] if p==1 then print ("Removing: "..s) end os.remove(s) end end endwhile true do if p==1 then print("cycle start") end if p==1 then print(a) end press("video") sleep(1000) release("video") if p==1 then print("recording..") end sleep(b*1000) if p==1 then print("stopping rec...") end click("video") sleep(200) if p==1 then print("waiting for buffer...") end sleep(v) a=a+1 if a==c+1 then if p==1 then print("video files limit") end a=c dir = os.listdir("A/DCIM", false) count = table.getn(dir) s=dir[count] s="A/DCIM/"..s dir = os.listdir(s,false) count = table.getn(dir) s=s.."/" if p==1 then print("removing "..dir[1]) end os.remove(s..dir[1]) if p==1 then print("removing "..dir[2]) end os.remove(s..dir[2]) if p==1 then print("waiting for buffer...") end sleep(v) end if p==1 then print("cycle end") endend
Started by PhyrePhoX Feature Requests
Started by Marco General Discussion and Assistance
Started by paulgfx General Chat
Started by mattadata Script Writing
Started by ant_thomas Creative Uses of CHDK