Time Lapse confusion on A590 - Script Writing - CHDK Forum

Time Lapse confusion on A590

  • 3 Replies
  • 2988 Views
Time Lapse confusion on A590
« on: 03 / April / 2010, 02:22:22 »
Advertisements
Got this intervalometer code off the main CHDK site, but didn't see much in the way of support there, so figured I'd post here in hopes that someone can help explain this to me...  Here's the code:

Code: [Select]
--[[
@title Minimalistic Intervalometer
@param a Shooting interval, min
@default a 0
@param b ...sec
@default b 10
--]]
 
Interval = a*60000 + b*1000
 
function TakePicture()
    press("shoot_half")
        repeat sleep(50) until get_shooting() == true
    press("shoot_full")
    release("shoot_full")
    repeat sleep(50) until get_shooting() == false   
        release "shoot_half"
end
 
repeat
    StartTick = get_tick_count()
    TakePicture()
    sleep(Interval - (get_tick_count() - StartTick))
until false

Saved the code to a new .lua file (I called it interval.lua for easy ID...)  Camera loads it fine when I boot into alt firmware.  I even get the options for configuration within the firmware.  Here's the question.  When I power on and enable the CHDK alternate firmware, when I go to choose the intervalometer, I can set two options and here's where I get super confused...

Setting #1:  Shooting Interval: (in minutes)
Setting #2:  ...sec (

My first guess was the first was the interval between when shots are taken, and the latter is the number of seconds in total exposure.  But when I set the first to "1" and the second to 300, figured I would get 5 pics.  (one minute interval between shots for a total of 300 seconds or five minutes means 5 shots, right?)  Nope!  Got one shot.  My mind is not grabbing this for some reason...help?


*

Offline zeno

  • *****
  • 891
Re: Time Lapse confusion on A590
« Reply #1 on: 03 / April / 2010, 04:13:33 »
The interval between shots is the sum of a (in minutes) and b (in seconds), so you asked for an interval of 60 + 300 seconds = 6 minutes. The script will therefore take a photo EVERY 6 minutes. You probably didn't wait long enough for the second shot - it's a never-ending script.

To take a photo every minute either:
  set a to 1 and b to 0
or
  set a to 0 and b to 60
A570, S100, Ixus 127
Author of ASSIST, STICK, WASP, ACID, SDMInst, LICKS, WICKS, MacBoot, UBDB, CFGEdit

Re: Time Lapse confusion on A590
« Reply #2 on: 03 / April / 2010, 13:58:10 »
Ok, will try.  Guess I need to set the camera to not shut off either..

Re: Time Lapse confusion on A590
« Reply #3 on: 03 / April / 2010, 20:50:24 »
Awesome - it works as desired, tks!  Now, the question is how to get it to end after a pre-set amount of time.  I am guessing there are other variations on intervalometers that can do this, eh?  Saw this one:

http://chdk.wikia.com/wiki/LUA#yet_another_accurate_intervalometer

 

Related Topics


SimplePortal © 2008-2014, SimplePortal