i tried but i can't reach a costant interval between shots.
My goal is to shot a picture exactly every 2 sec because i've to log on the Arduino parameters in synch with the pictures.
I send to the USB, for example, this square wave: t0=5V t1=0V t2=0V with t0=0ms, t1=100ms and t2=3000ms but the camera shots every 3200ms, 2500ms, 3300ms...
I reached quite good results with the standard "USB remote" but i hope to improve them with your script and fw.
CHDK has built in USB remote menu options, including synch delay. I haven't used it, but it may be able to do what you want without using my time lapse mods. Maybe @waterwingz can help you? I'm thinking a simple script that just holds the shutter down in continuous drive mode combined with the right CHDK usb remote menu options might work:
press("shoot_full")
repeat until false
I'm not sure why my script didn't trigger. I'm looking for a change in USB power from on to off. Maybe it's not off long enough for the script to detect it. Anyway, if it's detecting the USB trigger built into CHDK, then I can detect it as a key click in a script.
Here's the script modified to sync to key clicks. You can press any camera key to trigger a picture, or trigger it through USB (if it works). Press <menu> to exit. Also, I modified the script abort key in my CHDK build. You press the <ALT> key to abort a script, instead of the shutter button.
--[[
@title USBLapse 130910
@param m Max Interval (msec)
@default m -1
--]]
--MUST BE IN CONTINUOUS MODE
if(m<0)then m=1234567890 end -- 2 week interval default
set_shot_interval(m,0) --Maximum interval, no script handshake delays
nshot=1
print("Holding shoot_full")
print("Press <menu> to exit")
press("shoot_full") -- continuous mode
repeat
wait_click(10)
if(not is_key("no_key")) then
set_shot_interval(-1) --takes one shot immediately with any key click or usb remote
end
if(get_shot_ready())then
print(nshot,get_shot_data(4)) -- shot #, interval from last shot
nshot=nshot+1
end
until is_key("menu")
By the way, the interval using my set_shot_interval() function is very precise. If you want a 2 second interval, set the Max Interval parameter in the script to 2000. The script could then send a USB power output pulse to your board in between pictures, so you could pan the camera without messing up a shot, if that's what you're up to. In other words, instead of triggering the camera with the external board, you can trigger the board with the camera.
[edit] I just noticed that you asked about USBLapse.lua in another topic, where it started. Sorry for the confusion. We may as well keep it in this topic now. For reference, the initial USBLapse discussion topic is here:
http://chdk.setepontos.com/index.php?topic=9188.msg105038#msg105038