Canon Camera Hackers Manual page 93

Camera hackers manual berthold daum
Table of Contents

Advertisement

84
C H A P T E R 5
Scripting
The subroutine display asks the camera for the current display state. The
necessary clicks are performed only if it differs from the desired state. It
then sleeps for a while to let the camera adjust to the new settings. This is
done repeatedly until the desired result is reached.
:mode
r = get_prop 49
while r <> e
click "set"
sleep 1250
click "right"
sleep 1250
click "set"
sleep 1250
p = p + 1
r = get_prop 49
wend
return
The subroutine mode works in a similar way. The main difference is that it
has to perform a whole series of clicks to switch to the next mode
SET, RIGHT, FUNC/SET). It also counts the number of mode switches in
variable p. There are many sleep instructions in this subroutine. Switching
modes is quite hard work for the camera; in some cases lenses have to be
shifted, and so on. Depending on the camera, some tweaking may be nec-
essary for the necessary sleep intervals.
Because there is no direct uBasic command for obtaining the current
camera mode, we need to retrieve the mode in a different way. Here we
read out the value of Property Case 49 (section 5.6) that reflects the current
camera mode. It should be mentioned that this part of the script runs only
under the DryOS operating system ( Digic III and Digic IV) because property
IDs and mode values differ between VxWorks and DryOS. We will see later
that the script language Lua provides the necessary capabilities to write
platform-independent scripts.
:restor
click "set"
sleep 1250
for r = 1 to p
click "left"
next r
sleep 1250
click "set"
sleep 1250
return
(FUNC/

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Powershot sx10 is

Table of Contents