5.2 uBasic
83
until r = 1
release "shoot_half"
return
These are the
subroutines for user interaction. They simulate
button
presses and wait (
sleep
) for some milliseconds to give the camera time to
perform the task. Zooming in and out is quite simple this way. Focusing is a
bit more demanding. First, we have to half-press the shutter button. In-
stead of using the
click
command that simulates only a short click, we use
a
press
command to hold the shutter button half-down. Then we wait
until the command
get_shooting
returns the value 1. This indicates that
focusing has finished, so we can now release the shutter button.
:zoom
r = get_zoom
if r < s then
for n = r to s
click "zoom_in"
sleep 200
next n
else if r > s then
for n = s to r
click "zoom_out"
sleep 200
next n
endif
return
The subroutine
zoom
is used to set the initial zoom level or to restore it at
the end of the script. First, it asks
get_zoom
for the current zoom level. If the
desired zoom level in variable
s
is larger than the current one, it clicks the
zoom_in
button repeatedly to adjust for the difference—and vice versa, if
the current zoom level is larger than
s
, the button
zoom_out
is clicked in-
stead. This way, we reach the desired zoom level independently from the
initial zoom level.
:display
r = get_display_mode
while r <> d
click "display"
sleep 1250
r = get_display_mode
wend
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 ...