Canon Camera Hackers Manual page 193

Camera hackers manual berthold daum
Table of Contents

Advertisement

184
C H A P T E R 5
Scripting
if b > 0 then b = 1 else b = 0
z = get_zoom_steps
if m = 0 then
s = s - 1 rem 0..s-1
if z < s then
s = z
endif
c = get_zoom
n = (c * s + z/2) / z
d = 1 rem zoom in
if n >= s then
d = -1 rem zoom out
endif
endif
set_zoom_speed 100
e = get_day_seconds + 50
The main while loop contains an inner do loop that waits on a signal from
the USB port. Within this loop, the display backlight is set to the desired
state. If power-down is to be inhibited, the subroutine wakeup is called.
When a USB signal arrives (indicated by p>0), the duration of the pulse
is analyzed. If the duration is shorter than 500 msec or if zooming had been
disabled by setting parameter s to a value <= 1, the camera is fired. Other-
wise, the subroutine zoom is executed. Afterwards, the script loops and
waits for the next signal:
while 1
do
set_backlight b
if t <= 0 then gosub "wakeup"
p = get_usb_power
until p > 0
print "USB Pulse",p * 10;"msec"
if p > 50 and s > 0 then
gosub "zoom"
else
shoot
endif
wend
end
The subroutine wakeup "tickles" the camera every 50 sec by pressing the
FUNC/SET
button twice. This will keep the camera from powering down. As

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Powershot sx10 is

Table of Contents