![background image](http://html.mh-extra.com/html/canon/camera/camera_hackers-manual_59969194.webp)
5.7 Example scripts
185
a matter of fact, it is essential that the camera’s native time-out interval for
power-down is set to a value of one minute or more.
:wakeup
r = get_day_seconds
if r > e then
click "set"
click "set"
e = r + 50
endif
return
Finally, the subroutine
zoom
is responsible for performing the zoom opera-
tion, depending on the mode parameter
m
:
f
In
Step mode,
the current step value
n
is incremented by the value of the
direction indicator
d
. If
n
hits the lower or upper limit,
d
is inverted. Then
the physical step value is computed.
f
In
Seconds mode,
the physical step value is computed directly from the
pulse length.
After setting the new zoom level, a
sleep
command is issued to allow the
camera to adjust the lens before new USB signals are accepted:
:zoom
if m = 0 then
rem Step mode
n = n + d
if n = 0 or n = s then
d = -d
endif
c = (n * z + s / 2) / s
else
rem Seconds mode
i = s * 100 - 50
c = ((p - 50) * z + i / 2) / i
if c > z then
c = z
endif
endif
set_zoom c
sleep 500
return
Содержание Camera
Страница 1: ......
Страница 2: ...The Canon Camera Hackers Manual ...
Страница 3: ......
Страница 4: ...Berthold Daum The Canon Camera Hackers Manual Teach Your Camera New Tricks ...
Страница 19: ...10 CH APTER 2 Cameras and Operating Systems ...
Страница 25: ...16 CH APTER 3 ...
Страница 85: ...76 CH APTER 4 Teach Your Camera New Tricks ...
Страница 213: ...204 CH APTER 6 ...
Страница 253: ...244 AP PENDIX ...