Canon Camera Hackers Manual page 183

Camera hackers manual berthold daum
Table of Contents

Advertisement

174
C H A P T E R 5
Scripting
The variable z controls the display backlight. It is possible to switch the
backlight off while waiting for a movement, or completely until the script
is interrupted. By saving battery power, the camera can be used for longer
surveillance tasks.
Then motion detection starts. The result is written into variable cells
that contain the number of grid cells where motion is detected. If motion
detection times out, cells contains the value 0. When a motion is de-
tected, a shot can be taken. If immediate autofocus (u==0) is selected, the
subroutine focus is called again. Then the shot is performed by using the
command press("shoot_full"). Note that the command press() and
not the command click() is used so that the shutter button stays pressed.
In the case of series and video sequences, the subroutines series and
video are called instead. Finally, a message is printed to the screen and the
image counter is incremented.
The backlight is switched on again, if desired. The script then pauses
optionally and releases the shutter button. During that pause, the camera
remains in review mode showing the image taken on the display. Then we
wait until the camera is ready to shoot again. In the case of a timeout
(cells==0), we perform the subroutine wake to stop the camera from pow-
ering down. The camera is now ready for the next cycle:
-- event loop
shots = 0
print("Stop: Shutter Button")
while true do
if get_raw() then
if get_raw_count() == 0 then
break
end
else
if get_jpg_count() == 0 then
break
end
end
if (s > 0 and s < 3 and u ~= 0)
focus()
if u == 0 then
release("shoot_half")
end
end
if z <= 1 then
set_backlight(0)
end
or f < 0 then

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Powershot sx10 is

Table of Contents