local threshold = adapt(f)
local cells = md_detect_motion(a,
b, c, d, e, threshold, grid,
nil, i, j, k, l, m, 0, o, p)
if cells > 0 then
if s > 0 then
if u == 0 then focus() end
if s == 1 then
press("shoot_full")
elseif s ==2 then
series(t * 1000)
else
video(t * 1000)
end
else
playsound(1) -- shutter sound
end
shots = shots + 1
print(shots..": "..cells.."
cells, Threshold: "..threshold)
end
if z == 1 or v < 0 then
set_backlight(1)
end
if v ~= 0 then pause(v) end
if cells > 0 then
release("shoot_full")
wait()
cells = 0
else
wake() -- inhibit power down
end
end
This concludes the implementation of the motion script. Now let's see how
the scene programs differ from each other and how to use them. When
using the script, you should set the camera's native time-out for power-
down to at least one minute.
5.7 Example scripts
175