CHDK Wiki
Advertisement

Focus Bracketing with set_focus and get_focus

Written for/on: Powershot A630, CHDK Build 125 or later required.
Also works on: (unknown at this time)

This is a new focus bracketing script. It uses set_focus to set the focus and is faster and more reliable than other scripts.

Script Code (save as "focus2.bas" to your /SCRIPTS/ folder)

rem Author Bubendorf
@title Focus2
@param a Number of ±steps 
@default a 2
@param b Step size [x6]
@default b 6

if a<1 then let a=2
if b<1 then let b=1

sleep 500
get_focus f

for s=-a to a
  g=f
  if s<0 then gosub "negative"
  if s>0 then gosub "positive"
  print "Shoot", s, "(", g, ")"
  set_focus g
  shoot
next s
set_focus f

end

:negative
  for i=s to -1
   g=6*g/(b+6)
  next i
return

:positive
  for i=1 to s
   g=g*b/6+g
  next i
return
Advertisement