SDM uBasic Commands



SDM supports a subset of the CHDK scripting commands and introduces some of its own.
Most users will use publically-available scripts or, if writing their own, will use relatively few of the available commands.

For reference, the SDM-supported commands are listed below.

Script header and remarks

@default
@param
@title
rem

Logic commands

<:>
<=
>=
<
><
and
not
or

Control and branching

call
do
else
endif
for
gosub
goto
if
let
next
return
step
then
to
until
wend
while

Mini-console messages

cls
print
print_screen

Camera Operation

click
wait_click
press
release
shoot
sleep
is_key
wheel_left
wheel_right
get_autostart
get_day_seconds
get_dof
get_flash_mode
get_mode
get_prop
get_quality
get_resolution
get_shooting
get_tick_count
get_usb_power
get_user_tv_id get_video_button

playsound

set_autostart
set_av
set_iso
set_led
set_nd_filter
set_prop
set_quality
set_resolution
set_raw
set_tv
set_zoom
set_zoom_speed
set_zoom_rel

md_detect_motion
md_get_cell_diff

exit_alt
disable_main_flash
enable_main_flash

SDM Commands

beep
disable_usb_download
enable_usb_download
get_camera_position
get_cam_spacing
get_coc
get_deviation
get_deviation_factor
get_far_for_max_dev
get_foc_mode
get_max_accept_dev
get_nearpoint_factor
get_percent_deviation
get_sensor_width
get_shift
get_shooting_mode
get_sync

set_sync a b c d
'a' = 'Enable Synch' (1 = enable, 0 = disable) b = 'Enable Synch delay' (1 = enable, 0 = disable) c (delay in 0.1 msec units) d (delay in 0.1 sec units)

amber_led_on
amber_led_off
af_led_on
af_led_off
blue_led_on
blue_led_off
green_led_on
green_led_off
yellow_led_on
yellow_led_off
timer_led_on
timer_led_off
show_stereo_osd
hide_stereo_osd