Canon Camera Hackers Manual page 179

Camera hackers manual berthold daum
Table of Contents

Advertisement

170
C H A P T E R 5
Scripting
function pause(duration)
if duration < 0 then
repeat
until is_pressed("display")
else
print(duration.."s pause")
sleep(duration*1000)
end
end
function wait()
repeat until not get_shooting()
end
function wake()
release("shoot_half")
click("set")
click("set")
end
The function pause() waits for the specified time. If a negative duration is
specified, it waits for the
The function wait() simply waits until the camera has completed the
processing of a shot. When this happens, the function get_shooting() re-
turns false.
The function wake() is invoked in the case of a timeout when no motion
is detected. It releases the shutter button so that it can be half-pressed
again to update focus and exposure. Then it clicks the
twice, which does nothing except prevent the camera from falling asleep.
Now we can start with the execution of the main script. The first step is
to define the different scene programs. Here we use a powerful feature of
Lua: the ability to store functions in tables. Each scene program is repre-
sented by a function. When you select a scene program, the corresponding
function will be invoked and will set the script parameters as required. We
will explain the predefined scene programs and their parameters at the
end of the script.
There are two tables: the first contains the scene program names (la-
bels); the second contains the corresponding functions. It is just a matter
of adding additional labels and functions to extend this script with addi-
tional scene programs:
print("Continue: DISP")
wait_click(3000)
DISP
button to be clicked.
FUNC/SET
button

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Powershot sx10 is

Table of Contents