152
C H A P T E R 5
Scripting
pcall(function()
require("chdklib")
schedules = "SCHED"
end
)
The functions
set_display_mode()
and
sleep_until()
are not really new.
They are simply copied from the
Accurate Time Lapse
script at the begin-
ning of section 5.7.1.
props = require "propcase"
function set_display_mode(mode)
while get_prop(props.DISPLAY_MODE)
~= mode do
click("display")
sleep(100)
end
end
function sleep_until(time)
repeat
local sleep_time =
time - get_tick_count()
if sleep_time <= 0 then
return false
end
wait_click(sleep_time)
if is_pressed("set") then
return true
end
until is_pressed("no_key")
end
Function
focus()
, however, does a bit more than its sibling in the
Accurate
Time Lapse
script. It performs the required focusing operations. In case of
immediate focusing (
F
), the shutter button is pressed halfway to perform
the focusing. The
repeat
loop waits until this process has completed. Then
the autofocus system is locked. A parameter value of
A
releases the lock
again. Other values are numeric and specify the subject distance. This is set
with
set_focus()
after locking the autofocus system.
Summary of Contents for Camera
Page 1: ......
Page 2: ...The Canon Camera Hackers Manual ...
Page 3: ......
Page 4: ...Berthold Daum The Canon Camera Hackers Manual Teach Your Camera New Tricks ...
Page 19: ...10 CH APTER 2 Cameras and Operating Systems ...
Page 25: ...16 CH APTER 3 ...
Page 85: ...76 CH APTER 4 Teach Your Camera New Tricks ...
Page 213: ...204 CH APTER 6 ...
Page 253: ...244 AP PENDIX ...