EasyManua.ls Logo

Canon Camera - Page 178

Canon Camera
257 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
5.7 Example scripts 169
The function adapt() is used to compute the threshold (sensitivity) de-
pending on the scene brightness value measured by the camera. We get
this value with the CHDK function get_bv96(). The following formula is
heuristic and was found acceptable during trials. It may be changed if re-
quired. The resulting threshold value in variable w is then clipped between
12 and 36 and returned. If the incoming threshold has a positive value, it is
simply returned—no dynamic shareholding is wanted in this case:
function focus()
if u <= 0 or f < 0 then
press("shoot_half")
end
if u > 0 then set_focus(u * 10) end
repeat until get_shooting()
end
Function focus() is used for prefocusing or for immediate focusing. It
works by pressing the shutter button halfway. This is also done in the case
of dynamic shareholding (f<0) because the shutter button must be half-
pressed to determine the scene brightness. If a fixed subject distance is
specified (u>0), this distance is set. After all these preparations, the func-
tion waits until the camera is ready to shoot:
function series(duration)
press("shoot_full")
sleep(duration)
release("shoot_full")
end
function video(duration)
click("shoot_full")
sleep(duration)
click("shoot_full")
end
Triggering a time series or a video clip works a bit differently from taking a
photo. For a time series, the shutter button must be pressed, then after a
while released again. For a video clip, the shutter button must be clicked
(pressed and released), and after a while it must be clicked again:

Table of Contents

Related product manuals