122
C H A P T E R 5
Scripting
5.5.7
Time-related
commands
sleep t
uBasic
sleep(t)
Lua
Specifies how long the script will wait in milliseconds. The timer resolution depends
on the camera model and is in the range between 10–30 milliseconds.
s = get_day_seconds
uBasic
s = get_day_seconds()
Lua
Returns the number of seconds since midnight.
t = get_tick_count
uBasic
t = get_tick_count()
Lua
Returns the number of milliseconds since the camera was switched on.
t = get_time u
uBasic
u = 0 returns second, u = 1 minute, u = 2 hour, u = 3 day, u = 4 month, u = 5 year.
t = get_time(u)
Lua
u = ‘s’ returns second, u = ‘m’ minute, u = ‘h’ hour, u = ‘D’ day, u = ‘M’ month,
u = ‘Y’ year.
5.5.8 Display-related commands
x = get_display_mode
uBasic
x = get_display_mode()
Lua
Returns the display mode: 0 = info, 1 = no info, 2 = off, 3 = electronic viewfinder.
shot_histo_enable x
uBasic
shot_histo_enable(x)
Lua
Switches the histogram on or off: 0 = off, 1 = on.
get_histo_range s,h,p
uBasic
p = get_histo_range(s,h)
Lua
Retrieves histogram data from the previous shot. A shadow value (0–1023) is speci-
fied in the variable
s
; a highlight value (s–1023) is specified in the variable
h
. The
value returned in variable
p
is the percent of pixels within that brightness range.
Can be used for sophisticated exposure control.
md_detect_motion ...
uBasic
h = md_detect_motion(...)
Lua
Detects motion (section 5.7.3)
n = md_get_cell_diff
uBasic
n = md_get_cell_diff()
Lua
Allows analyzing detected motion in more detail (section 5.7.3).
Содержание 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 ...