Canon Camera Hackers Manual page 160

Camera hackers manual berthold daum
Table of Contents

Advertisement

The last (and optional) clause controls the display:
I switches to the info display.
f
N switches to the normal display (no info).
f
D switches the display off to save power.
f
Lines that start with two dashes (--) are considered as comments and are
printed to the display. Here are a few examples for script files:
-- Example
F 0 D
1:0 10 15
A 5:0 10 15-5
This schedule file results in the following actions:
1. "Example" is printed to the display.
2. The first shot in the schedule is taken immediately. The camera is fo-
cused before the shot and the focus is locked. The display is switched
dark.
3. After one minute, the camera takes 10 shots with an interval of 15 sec-
onds between shots.
4. Finally, at MET 00:05:00, the camera switches back to autofocus and
takes another 10 shots starting with an interval of 15 seconds and end-
ing with an interval of 5 seconds.
Now let's analyze the script and see how it works. It uses some elements
that we developed already in the previous two scripts, such as file brows-
ing, display mode switching, and exact timing. What is new here is reading
file content and parsing (interpreting) that content. Basically, this is a script
that reads and executes a script (the schedule file).
The header defines the script title. The schedule files are expected in
folder A/CHDK/SCHED. The function idiv() implements integer division and
is used instead of the standard division in order to achieve compatibility
with the PC version of Lua. The following pcall() expression is the connec-
tion to the debug environment on the PC (section 5.8).
--[[
@title Scheduled timeseries
--]]
schedules = "A/CHDK/SCHED"
function idiv(a,b)
return (a-(a%b))/b
end
5.7 Example scripts
151

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Powershot sx10 is

Table of Contents