Wikia

CHDK Wiki

Changes: CHDK Scripting Cross Reference Page

Edit

Back to page

(All Scripting Functions: added set_exit_key())
m (All Scripting Functions: fixed wait_click link)
 
(33 intermediate revisions by 3 users not shown)
Line 33: Line 33:
 
|[[Lua/PTP_Scripting|Lua PTP Scripting]]
 
|[[Lua/PTP_Scripting|Lua PTP Scripting]]
 
|-
 
|-
|[[Lua/Drawings|Lua Draw Functions]]
+
|[[Lua/Lua_Reference#Drawings|Lua Draw]] & [[Lua/Drawings|Lua Drawing]]
 
|[[Lua/Lua_Reference/Native_Function_Calls#call_event_proc.28name.2C....29|Native Function Calls]]
 
|[[Lua/Lua_Reference/Native_Function_Calls#call_event_proc.28name.2C....29|Native Function Calls]]
 
|-
 
|-
 
| [[Lua_Development_Environment|Lua Development Environment]]
 
| [[Lua_Development_Environment|Lua Development Environment]]
 
| [http://www.lua.org/manual/5.1/ Lua 5.1 Reference Manual ]
 
| [http://www.lua.org/manual/5.1/ Lua 5.1 Reference Manual ]
  +
|-
  +
| [[CHDK_Lua_Reference_Card|One Page CHDK Lua Reference Card]]
  +
|
 
|}
 
|}
   
Line 73: Line 76:
 
|-
 
|-
 
| align="center" | [[Script_commands#get_zoom_steps | get_zoom_steps ]]||Y||Y||returns the number of zoom steps supported by the camera
 
| align="center" | [[Script_commands#get_zoom_steps | get_zoom_steps ]]||Y||Y||returns the number of zoom steps supported by the camera
  +
|-
  +
| align="center" | [[Script_commands#get_sd_over_modes | get_sd_over_modes ]]||Y||Y||returns a bit field value indicating when subject distance override will work with this camera.
  +
|-
  +
| align="center" | [[Script_commands#set_mf | set_mf ]]||Y||Y||lock/unlock Canon manual focus (MF) mode.
 
|-
 
|-
 
| align="center" | [[Script_commands#set_aflock | set_aflock ]]||Y||Y||blocks the camera firmware from making focus adjustments
 
| align="center" | [[Script_commands#set_aflock | set_aflock ]]||Y||Y||blocks the camera firmware from making focus adjustments
Line 145: Line 152:
 
|-
 
|-
 
| align="center" | [[CHDK_scripting#get_user_tv96 | get_user_tv96 ]]||Y||Y||gets M mode override APEX96 exposure value
 
| align="center" | [[CHDK_scripting#get_user_tv96 | get_user_tv96 ]]||Y||Y||gets M mode override APEX96 exposure value
  +
|-
  +
| align="center" | [[Script_commands#set_aelock| set_aelock ]]||Y||Y||sets automatic exposure lock (AEL) ( CHDK 1.3.0 or newer)
 
|-
 
|-
 
| align="center" | [[CHDK_scripting#set_av | set_av ]]||N||Y||obsolete - replaced with set_user_av_by_id
 
| align="center" | [[CHDK_scripting#set_av | set_av ]]||N||Y||obsolete - replaced with set_user_av_by_id
Line 279: Line 288:
 
|-
 
|-
 
| align="center" | [[Script_commands#restore | restore ]]||Y||Y||specifies the routine called before a script terminates
 
| align="center" | [[Script_commands#restore | restore ]]||Y||Y||specifies the routine called before a script terminates
|-
 
| align="center" | [[Script_commands#set_backlight.28.29 | set_backlight ]]||Y||Y||turns the LCD screen backlight on or off
 
 
|-
 
|-
 
| align="center" | [[Script_commands#set_capture_mode.28modenum.29 | set_capture_mode ]]||Y||Y||set capture mode by CHDK mode number
 
| align="center" | [[Script_commands#set_capture_mode.28modenum.29 | set_capture_mode ]]||Y||Y||set capture mode by CHDK mode number
Line 312: Line 319:
 
| align="left" style="background:#e6e1e4;"|'''Description'''
 
| align="left" style="background:#e6e1e4;"|'''Description'''
 
|-
 
|-
| align="center" | [[CHDK_scripting#Camera_Operation_Commands | click ]]||Y||Y||press and release a key
+
| align="center" | [[CHDK_scripting#Camera_Button_Commands| click ]]||Y||Y||press and release a key
 
|-
 
|-
 
| align="center" | [[CHDK_scripting#is_key | is_key ]]||Y||Y||detemines if specified key was pressed
 
| align="center" | [[CHDK_scripting#is_key | is_key ]]||Y||Y||detemines if specified key was pressed
 
|-
 
|-
| align="center" | [[Script_commands#is_pressed_.22key.22 | is_pressed ]]||Y||Y||determines if specified key is being pressed
+
| align="center" | [[CHDK_scripting#is_pressed_.22key.22| is_pressed ]]||Y||Y||determines if specified key is being pressed
 
|-
 
|-
| align="center" | [[CHDK_scripting#click.2Fpress.2Frelease_.22up.22.2C_.22down.22.2C_.22left.22.2C_.22right.22 | press ]]||Y||Y||activates the specified camera button
+
| align="center" | [[CHDK_scripting#Camera_Button_Commands| press ]]||Y||Y||activates the specified camera button
 
|-
 
|-
| align="center" | [[CHDK_scripting#click.2Fpress.2Frelease_.22up.22.2C_.22down.22.2C_.22left.22.2C_.22right.22 | release ]]||Y||Y||releases the specified camera button
+
| align="center" | [[CHDK_scripting#Camera_Button_Commands| release ]]||Y||Y||releases the specified camera button
 
|-
 
|-
 
| align="center" | [[CHDK_scripting#shoot | shoot ]]||Y||Y||takes a picture
 
| align="center" | [[CHDK_scripting#shoot | shoot ]]||Y||Y||takes a picture
 
|-
 
|-
| align="center" | [[CHDK_scripting#wait_click_.2F_is_key | wait_click ]]||Y||Y||waits for any camera button to be pressed
+
| align="center" | [[CHDK scripting#wait click| wait_click ]]||Y||Y||waits for any camera button to be pressed
 
|-
 
|-
 
| align="center" | [[CHDK_scripting#wheel_left | wheel_left ]]||Y||Y||simulates moving jog dial wheel to the left
 
| align="center" | [[CHDK_scripting#wheel_left | wheel_left ]]||Y||Y||simulates moving jog dial wheel to the left
 
|-
 
|-
 
| align="center" | [[CHDK_scripting#wheel_right | wheel_right ]]||Y||Y||simulates moving jog dial wheel to the right
 
| align="center" | [[CHDK_scripting#wheel_right | wheel_right ]]||Y||Y||simulates moving jog dial wheel to the right
  +
|-
  +
| align="center" | [[Script_commands#set_exit_key | set_exit_key ]]||Y||Y||changes the key used to terminate the script (CHDK 1.3.0 or greater)
 
|-
 
|-
 
| align="left" style="color:#FFFFFF; background:#06718e;"|'''''SD Card Functions'''''
 
| align="left" style="color:#FFFFFF; background:#06718e;"|'''''SD Card Functions'''''
Line 345: Line 354:
 
|-
 
|-
 
| align="center" | [[Lua/Lua_Reference#get_image_dir | get_image_dir ]]||Y||N|| get current image directory
 
| align="center" | [[Lua/Lua_Reference#get_image_dir | get_image_dir ]]||Y||N|| get current image directory
  +
|-
  +
| align="center" | [[Lua/Lua_Reference#file_browser.28path.29 | file_browser ]]||Y||N||activate SD card file browser on LCD screen
 
|-
 
|-
 
| align="center" | [[CHDK_scripting#get_disk_size | get_free_disk_space ]]||Y||Y||return space left on SD card
 
| align="center" | [[CHDK_scripting#get_disk_size | get_free_disk_space ]]||Y||Y||return space left on SD card
Line 350: Line 361:
 
| align="center" | [[CHDK_scripting#get_jpg_count | get_jpg_count ]]||Y||Y||return number of JPG shots left on SD card
 
| align="center" | [[CHDK_scripting#get_jpg_count | get_jpg_count ]]||Y||Y||return number of JPG shots left on SD card
 
|-
 
|-
| align="center" | [[Script_commands#get_partitionInfo | get_partitionInfo ]]||Y||Y||get partition information from the SD card
+
| align="center" | [[Script_commands#get_partitionInfo | get_partitionInfo ]]||Y||N||get partition information from the SD card
 
|-
 
|-
| align="center" | [[Script_commands#set_file_attributes | set_file_attributes ]]||Y||Y||set file attributes of file on SD card
+
| align="center" | [[Script_commands#set_file_attributes | set_file_attributes ]]||Y||N||set file attributes of file on SD card
 
|-
 
|-
 
| align="center" | [[Script_commands#swap_partition | swap_partitions ]]||Y||Y||changes the partition order if SD card has multiple partitions
 
| align="center" | [[Script_commands#swap_partition | swap_partitions ]]||Y||Y||changes the partition order if SD card has multiple partitions
Line 369: Line 380:
 
|-
 
|-
 
| align="center" | [[CHDK_scripting#end | end ]]||N||Y||terminate uBASIC program execution
 
| align="center" | [[CHDK_scripting#end | end ]]||N||Y||terminate uBASIC program execution
|-
 
| align="center" | [[Lua/Lua_Reference#file_browser.28path.29 | file_browser ]]||Y||Y||activate SD card file browser on LCD screen
 
 
|-
 
|-
 
| align="center" | [[Script_commands#get_autostart_.26_set_autostart | get_autostart ]]||Y||Y||reads the conf.script_autostart
 
| align="center" | [[Script_commands#get_autostart_.26_set_autostart | get_autostart ]]||Y||Y||reads the conf.script_autostart
Line 382: Line 391:
 
| align="center" | [[Script_commands#get_autostart_.26_set_autostart | set_autostart]]||Y||Y||write conf.script_autostart (0=off, 1=on, 2=once)
 
| align="center" | [[Script_commands#get_autostart_.26_set_autostart | set_autostart]]||Y||Y||write conf.script_autostart (0=off, 1=on, 2=once)
 
|-
 
|-
| align="center" | [[Script_commands#set_yield | set_exit_key ]]||Y||Y||changes the key used to terminate the script (CHDK 1.3.0)
+
| align="center" | [[ Script_commands#set_yield | set_yield ]]||Y||Y||control how much of the Camera CPU time is used by scripting engine
|-
 
| align="center" | [[Script_commands#set_exit_key | set_yield ]]||Y||Y||control how much of the Camera CPU time is used by scripting engine
 
 
|-
 
|-
 
| align="center" | [[CHDK_scripting#Sleep | sleep ]]||Y||Y||halts program execution for specified number of milliseconds
 
| align="center" | [[CHDK_scripting#Sleep | sleep ]]||Y||Y||halts program execution for specified number of milliseconds
Line 414: Line 423:
 
| align="center" | [[Lua/Lua_Reference/Levent | set_levent_script_mode ]]||Y||N||<needs a definition>
 
| align="center" | [[Lua/Lua_Reference/Levent | set_levent_script_mode ]]||Y||N||<needs a definition>
 
|-
 
|-
| align="left" style="color:#FFFFFF; background:#06718e;"|'''''Text Console'''''
+
| align="left" style="color:#FFFFFF; background:#06718e;"|'''''Display & Text Console'''''
 
| align="center" style="background:#06718e;"|
 
| align="center" style="background:#06718e;"|
 
| align="center" style="background:#06718e;"|
 
| align="center" style="background:#06718e;"|
Line 423: Line 432:
 
| align="center" style="background:#e6e1e4;"|'''uBASIC'''
 
| align="center" style="background:#e6e1e4;"|'''uBASIC'''
 
| align="left" style="background:#e6e1e4;"|'''Description'''
 
| align="left" style="background:#e6e1e4;"|'''Description'''
  +
|-
  +
| align="center" | [[Script_commands#set_backlight.28.29 | set_backlight ]]||Y||Y||turns the LCD screen backlight on or off
  +
|-
  +
| align="center" | [[Script_commands#set_lcd_display.28.29 | set_lcd_display ]]||Y||Y||turns the LCD screen on or off (CHDK 1.3.0 or greater)
  +
|-
  +
| align="center" | [[Script_commands#set_draw_title_line | set_draw_title_line]]||Y||Y||turns the CHDK title line on or off  (CHDK 1.3.0 or greater)
  +
|-
  +
| align="center" | [[Script_commands#get_draw_title_line | get_draw_title_line]]||Y||Y||returns the current CHDK title state  (CHDK 1.3.0 or greater)
 
|-
 
|-
 
| align="center" | [[UBASIC/TutorialScratchpad#The_.22cls.22_Command | cls ]]||Y||Y||clear console screen
 
| align="center" | [[UBASIC/TutorialScratchpad#The_.22cls.22_Command | cls ]]||Y||Y||clear console screen
Line 446: Line 463:
 
| align="left" style="background:#e6e1e4;"|'''Description'''
 
| align="left" style="background:#e6e1e4;"|'''Description'''
 
|-
 
|-
| align="center" | [[Lua/Lua_Reference#Drawings | draw_clear ]]||Y||N||clear drawing area on LCD screen
+
| align="center" | [[Lua/Drawings | draw.xxx ]]||Y||N||Lua drawing module
  +
|-
  +
| align="center" | [[Lua/Lua_Reference#Drawings | draw_ellipse ]]||Y||N||draws an ellipse on LCD screen
 
|-
 
|-
 
| align="center" | [[Lua/Lua_Reference#Drawings | draw_ellipse ]]||Y||N||draws an ellipse on LCD screen
 
| align="center" | [[Lua/Lua_Reference#Drawings | draw_ellipse ]]||Y||N||draws an ellipse on LCD screen
Line 502: Line 519:
 
| align="left" style="background:#e6e1e4;"|'''Description'''
 
| align="left" style="background:#e6e1e4;"|'''Description'''
 
|-
 
|-
| align="center" | [[CHDK_scripting#enter_alt | enter_alt ]]||Y||N||activates CHDK mode
+
| align="center" | [[CHDK_scripting#enter_alt | enter_alt ]]||Y||Y||activates CHDK mode (CHDK 1.3.0 or greater for uBASIC support)
 
|-
 
|-
 
| align="center" | [[CHDK_scripting#exit_alt | exit_alt ]]||Y||Y||exits CHDK mode
 
| align="center" | [[CHDK_scripting#exit_alt | exit_alt ]]||Y||Y||exits CHDK mode
  +
|-
  +
| align="center" | [[CHDK_scripting#get_alt_mode | get_alt_mode ]]||Y||Y||returns whether CHDK is in ALT mode or not (CHDK 1.3.0 or greater)
 
|-
 
|-
 
| align="center" | [[Lua/Lua_Reference#get_buildinfo | get_buildinfo ]]||Y||N||return info about CHDK version running on the camera
 
| align="center" | [[Lua/Lua_Reference#get_buildinfo | get_buildinfo ]]||Y||N||return info about CHDK version running on the camera
 
|-
 
|-
 
| align="center" | [[Script_commands#get_config_value | get_config_value ]]||Y||Y||get currently selected state of CHDK menu item
 
| align="center" | [[Script_commands#get_config_value | get_config_value ]]||Y||Y||get currently selected state of CHDK menu item
  +
|-
  +
| align="center" | [[Lua/Lua_Reference#load_.26_save_CHDK_configuration_files | set_config_autosave ]]||Y||N|| on/off for the autosave function of the CHDK configuration (CHDK 1.3.0 or greater)
  +
|-
  +
| align="center" | [[Lua/Lua_Reference#load_.26_save_CHDK_configuration_files | load_config_file ]]||Y||N||loads a CHDK configuration file (CHDK 1.3.0 or greater)
  +
|-
  +
| align="center" | [[Lua/Lua_Reference#load_.26_save_CHDK_configuration_files | save_config_file ]]||Y||N||saves a CHDK configuration file (CHDK 1.3.0 or greater)
 
|-
 
|-
 
| align="center" | [[Script_commands#get_histo_range | get_histo_range ]]||Y||Y||return % if values in given range on histogram
 
| align="center" | [[Script_commands#get_histo_range | get_histo_range ]]||Y||Y||return % if values in given range on histogram
Line 575: Line 600:
 
|-
 
|-
 
| align="center" | [[USB_Remote_V2#Scripting_Interface | get_usb_power ]]||Y||Y||get status of USB connector ( voltage present or not present )
 
| align="center" | [[USB_Remote_V2#Scripting_Interface | get_usb_power ]]||Y||Y||get status of USB connector ( voltage present or not present )
  +
|-
  +
| align="center" | [[USB_Remote_V2#enable_remote_hp_timer.28uSec.29 | enable_remote_hp_timer ]]||Y||Y||enabled high precision USB remote timing
 
|-
 
|-
 
| align="center" | [[Lua/PTP_Scripting#read_usb_msg | read_usb_msg ]]||Y||N||read a message from the CHDK ptp usb interface
 
| align="center" | [[Lua/PTP_Scripting#read_usb_msg | read_usb_msg ]]||Y||N||read a message from the CHDK ptp usb interface
Line 583: Line 610:
 
|-
 
|-
 
| align="center" | [[Lua/PTP_Scripting#switch_mode_usb | switch_mode_usb ]]||Y||N||set playback or record mode while PTP USB connected
 
| align="center" | [[Lua/PTP_Scripting#switch_mode_usb | switch_mode_usb ]]||Y||N||set playback or record mode while PTP USB connected
  +
|-
  +
| align="center" | [[Lua/PTP_Scripting#usb_force_active | usb_force_active ]]||Y||Y||force camera to believe USB 5V pin is active
 
|-
 
|-
 
| align="left" style="color:#FFFFFF; background:#06718e;"|'''''Tone Curves'''''
 
| align="left" style="color:#FFFFFF; background:#06718e;"|'''''Tone Curves'''''

Latest revision as of 21:46, November 14, 2014

CHDK Scripting LinksEdit

CHDK Scripts CHDK Scripting
Script Commands Script Commands Stub
User Written Scripts Property Case Values

uBASIC LinksEdit

uBASIC uBASIC Syntax
uBASIC Tutorial Scratchpad

Lua LinksEdit

Lua Lua Syntax
Lua Reference Lua PTP Scripting
Lua Draw & Lua Drawing Native Function Calls
Lua Development Environment Lua 5.1 Reference Manual
One Page CHDK Lua Reference Card

Script Header DocumentationEdit

The Script Header Tutorial - The Script Header

All Scripting FunctionsEdit

.

Lens Functions
Function Link Lua uBASIC Description
get_focus YYgets current focus distance in mm
get_focus_mode YYreturns focus mode, 0=auto, 1=MF, 3=inf., 4=macro, 5=supermacro
get_focus_ok YYreturns 0=focus not ok, 1=ok if get_focus_state<>0 and get_shooting=1
get_focus_state YYreturns focus status, > 0 focus successful, =0 not successful, < 0 MF
get_IS_mode YYget image stabilization mode
get_zoom YYreturns current zoom position
get_zoom_steps YYreturns the number of zoom steps supported by the camera
get_sd_over_modes YYreturns a bit field value indicating when subject distance override will work with this camera.
set_mf YYlock/unlock Canon manual focus (MF) mode.
set_aflock YYblocks the camera firmware from making focus adjustments
set_focus YYsets current focus distance in mm
set_zoom YYsets the current zoom position
set_zoom_rel YYmoves zoom position a relative amount
set_zoom_speed YYsets zoom speed (only works on some cameras)
Depth of Field
Function Link Lua uBASIC Description
get_dofinfo Y -get DOF table (uBASIC commands below)
get_dof -Yget the depth of sharpness in mm
get_far_limit -Yget the far acceptable sharpness distance
get_near_limit -Yget near acceptable sharpness distance
get_focal_length -Yget current lens focal length
get_hyp_dist -Yget hyperfocal distance
Exposure Functions
Function Link Lua uBASIC Description
get_av NYobsolete - replaced with get_user_av_id
get_av96 YYgets APEX96 aperature value
get_bv96 YYgets APEX96 luminance value
get_ev YYget exposure adjustment amount
get_iso NYobsolete - replaced with get_iso_mode
get_iso_market YYget inflated marketing ISO value
get_iso_mode YYobtain ISO mode
get_iso_real YYget actual ISO value
get_nd_present YYreturns whether camera has an ND filter (and / or diaphragm )
get_sv96 YYgets APEX96 ISO sensitivity setting
get_tv96 YYgets APEX96 exposure time
get_user_av_id YYgets M mode override APEX96 aperature value by index
get_user_av96 YYgets APEX96 aperature value
get_user_tv_id YYgets M mode override APEX96 exposure time by index
get_user_tv96 YYgets M mode override APEX96 exposure value
set_aelock YYsets automatic exposure lock (AEL) ( CHDK 1.3.0 or newer)
set_av NYobsolete - replaced with set_user_av_by_id
set_av_rel NYobsolete - replaced with set_user_ac_by_id_rel
set_av96 YYsets the APEX96 aperature value
set_av96_direct YYsets the APEX96 aperature value (bypass validation check)
set_ev YYsets exposure adjustment amount
set_iso NYobsolete - replaced with set_iso_mode
set_iso_mode YYsets propcase PROPCASE_ISO_MODE
set_iso_real YYsets the sv96 override value base on ISO sensitivity value
set_nd_filter YYmoves neutral density filter into or out of the optical path
set_sv96 YYset APEX96 ISO sensitivity value
set_tv NYobsolete - replaced with set_user_tv_by_id
set_tv_rel NYobsolete - replaced with set_user_tv_by_id_rel
set_tv96 YYset APEX96 exposure time
set_tv96_direct YYset APEX96 exposure time (bypass validity checks)
set_user_av_by_id YYset user override APEX96 aperature by index (M mode only)
set_user_av_by_id_rel YYset user override APEX96 aperature by index relative (M mode only)
set_user_av96 YYset user override APEX96 aperature (M mode only)
set_user_tv_by_id YYset user override APEX96 exposure time index (M mode only)
set_user_tv_by_id_rel YYset user override APEX96 exposure time index offset (M mode only)
set_user_tv96 YYset user override APEX96 exposure time (M mode only)
get_live_histo YN Get a histogram of the live viewport
APEX96 Conversion Note : CHDK 1.3.0 or greater
Function Link Lua uBASIC Description
iso_to_sv96 YYconverts ISO into sv96 units
sv96_to_iso YYconverts sv96 units to ISO
iso_real_to_market YYconverts ISO value from real to market
iso_market_to_real YYconverts ISO value from real to market
sv96_real_to_market YYconverts sv96 value from real to market
sv96_market_to_real YYconverts sv96 value from market to real
aperture_to_av96 YYconverts f-stop to av96 units
av96_to_aperture YYconverts av96 value to f-stop
usec_to_tv96 YYconverts shutter speed to tv96 units
tv96_to_usec YYconverts tv96 value to shutter speed
seconds_to_tv96 YYconverts fractional value to tv96 units
Camera Functions
Function Link Lua uBASIC Description
get_capture_mode NYgets current camera Program mode setting
get_display_mode NYreturns state of LCD display info
get_drive_mode YYreturns shutter drive mode (single, continuous, timer )
get_flash_mode YYreturns flash mode (flash auto, flash on, flash off)
get_flash_params_count YNreturns # of flash memory parameters available in camera
get_flash_ready YYreturns status indicating if flash is ready to fire
get_meminfo YNget camera memory information
get_mode YYreturns whether record mode or playback mode is active
get_movie_status YYgets state of video recording (off,on,paused)
get_orientation_sensor YYget camera rotation sensor value
get_parameter_data YNget data from camera\'s flash memory
get_prop YYget PropertyCase value as short integer
get_prop_str YNget the value of a PropertyCase as a string
get_propset YYget the propset number for this camera
get_quality NYreturns the current capture quality setting in Canon grades
get_resolution NYreturns the current capture resolution setting in Canon grades
get_shooting YYreturn value indicates if shooting is done
get_temperature YYreturns specified temperature sensor value
get_vbatt YYget current battery charge state
get_video_button YYreturns whether on not the camera has a video button
get_video_details YNreturns a struct with viewport configuration info
is_capture_mode_valid YYcheck if CHDK mode number is valid for this camera
play_sound Y*plays the specified sound sequence (uBASIC use playsound)
reboot YYrestart the camera
restore YYspecifies the routine called before a script terminates
set_capture_mode YYset capture mode by CHDK mode number
set_capture_mode_canon YYset capture mode by PROPCASE_SHOOTING_MODE value
set_led YYturns on or off the selected camera LED
set_movie_status YYallow video recording to pause, unpause and stop
set_prop YYset PropertyCase value as short integer
set_prop_str YNused to set arbitraty sized propcases in Lua
set_quality NYset the quality (in Canon grades),
set_record YYset playback or record mode
set_resolution NYSet the resolution (in Canon grades)
shut_down YYturns the camera off
Keypad & Switches
Function Link Lua uBASIC Description
click YYpress and release a key
is_key YYdetemines if specified key was pressed
is_pressed YYdetermines if specified key is being pressed
press YYactivates the specified camera button
release YYreleases the specified camera button
shoot YYtakes a picture
wait_click YYwaits for any camera button to be pressed
wheel_left YYsimulates moving jog dial wheel to the left
wheel_right YYsimulates moving jog dial wheel to the right
set_exit_key YYchanges the key used to terminate the script (CHDK 1.3.0 or greater)
SD Card Functions
Function Link Lua uBASIC Description
get_disk_size YYreturns size of SD card
get_exp_count YY return number of shots in a session
get_image_dir YN get current image directory
file_browser YNactivate SD card file browser on LCD screen
get_free_disk_space YYreturn space left on SD card
get_jpg_count YYreturn number of JPG shots left on SD card
get_partitionInfo YNget partition information from the SD card
set_file_attributes YNset file attributes of file on SD card
swap_partitions YYchanges the partition order if SD card has multiple partitions
Script Status Functions
Function Link Lua uBASIC Description
autostarted YYchecks if script was autostarted
end NYterminate uBASIC program execution
get_autostart YYreads the conf.script_autostart
get_day_seconds YYreturn number of seconds since midnight
get_tick_count YYgets time in tic units since camera startup
get_time YYreturns elements of the camera\'s current date / time setting
set_autostartYYwrite conf.script_autostart (0=off, 1=on, 2=once)
set_yield YYcontrol how much of the Camera CPU time is used by scripting engine
sleep YYhalts program execution for specified number of milliseconds
Firmware Interface
Function Link Lua uBASIC Description
call_event_proc(name,...) YNcalls a registered event procedure.
call_func_ptr(fptr,...) YNcall ARM or Thumb function in camera RAM or ROM
get_levent_def YNreturns (name, id, param) if index is valid, otherwise nil
get_levent_def_by_index YNreturns (name, id, param) if index is valid, otherwise nil
get_levent_index YNreturns the index of the given event
post_levent_for_npt YNTriggers a LogicalEvent in the Canon firmware.
post_levent_to_ui YNTriggers a LogicalEvent in the canon firmware.
set_levent_active YN<needs a definition>
set_levent_script_mode YN<needs a definition>
Display & Text Console
Function Link Lua uBASIC Description
set_backlight YYturns the LCD screen backlight on or off
set_lcd_display YYturns the LCD screen on or off (CHDK 1.3.0 or greater)
set_draw_title_lineYYturns the CHDK title line on or off  (CHDK 1.3.0 or greater)
get_draw_title_lineYYreturns the current CHDK title state  (CHDK 1.3.0 or greater)
cls YYclear console screen
console_redraw YYmanually refresh/rewrite the script console
print YYdisplays a line of text on console area of LCD screen
print_screen YYcauses text written to screen to also be written to file on the SD card
set_console_autoredraw YYenable or disable automatic rewrite/refresh of the console
set_console_layout YYsets the dimensions the LCD message console
LCD Graphics
Function Link Lua uBASIC Description
draw.xxx YNLua drawing module
draw_ellipse YNdraws an ellipse on LCD screen
draw_ellipse YNdraws an ellipse on LCD screen
draw_ellipse_filled YNdraws a filled ellipse on LCD screen
draw_line YNdraw a line on LCD screen
draw_pixel YNdraws a single pixel on LCD screen
draw_rect YNdraws a rectangle on LCD screen
draw_rect_filled YNdraws a filled rectangle on LCD screen
draw_string YNprints a text string on LCD screen
textbox YNinput text function for Lua scripts
RAW
Function Link Lua uBASIC Description
get_raw YYreturn status of RAW disabled or enabled
get_raw_count YYreturn number of RAW shots that will fit on remaining SD card space
get_raw_nr YYreturn state of RAW noise reduction ( off, on )
raw_merge_add_file YNadds a RAW file to the current merge process
raw_merge_end YNends a RAW merge process on the camera
raw_merge_start YNbegins a RAW merge process on the camera
set_raw YYenables or disables the storage of RAW images
set_raw_develop YNdevelop RAW image on next shot
set_raw_nr YYenables or disable noise reduction in RAW mode
CHDK Functionality
Function Link Lua uBASIC Description
enter_alt YYactivates CHDK mode (CHDK 1.3.0 or greater for uBASIC support)
exit_alt YYexits CHDK mode
get_alt_mode YYreturns whether CHDK is in ALT mode or not (CHDK 1.3.0 or greater)
get_buildinfo YNreturn info about CHDK version running on the camera
get_config_value YYget currently selected state of CHDK menu item
set_config_autosave YN on/off for the autosave function of the CHDK configuration (CHDK 1.3.0 or greater)
load_config_file YNloads a CHDK configuration file (CHDK 1.3.0 or greater)
save_config_file YNsaves a CHDK configuration file (CHDK 1.3.0 or greater)
get_histo_range YYreturn % if values in given range on histogram
get_platform_idNYget the camera's platform ID value
set_config_value YYsets specified CHDK config value to specified value
shot_histo_enable YYenables creation of histogram data from a shot
Programming
Function Link Lua uBASIC Description
bitand(a, b) YNreturns bitwise logical AND of two variables
bitnot(a) YNreturns bitwise inversion of a variable
bitor(a, b) YNreturns bitwise logical OR of two variables
bitshl(a) YNreturns logical shift left of a variable
bitshri(a) YNreturns logical right of a variable (top bit stays in same state afterwards)
bitshru(a) YNreturns logical right of a variable (top bit = 0 afterwards)
bitxor(a, b) YNreturns logical exclusive or of two variables
peek YNreads from specified camera memory address
poke YNwrites to specified camera memory address
Motion Detection
Function Link Lua uBASIC Description
md_detect_motion YYwaits for a change in specified screen cells caused by motion
md_get_cell_diff YYgets change in motion detect level in specified cell
md_get_cell_val YYgets signal level in specified cell
md_af_on_time YYenable AF led for MD response testing
USB Port Interface
Function Link Lua uBASIC Description
get_usb_power YYget status of USB connector ( voltage present or not present )
enable_remote_hp_timer YYenabled high precision USB remote timing
read_usb_msg YNread a message from the CHDK ptp usb interface
write_usb_msg YNwrite a message via the CHDK ptp interface
usb_msg_table_to_stringYN User-definable callback used convert tables to string for write_usb_msg and PTP return
switch_mode_usb YNset playback or record mode while PTP USB connected
usb_force_active YYforce camera to believe USB 5V pin is active
Tone Curves
Function Link Lua uBASIC Description
get_curve_file YNLua commands to control tone curves
get_curve_state YNLua commands to control tone curves
set_curve_file YNload a tone curve file
set_curve_state YNenable/disable the use of a tone curve file
imath functions
Function Link Lua uBASIC Description
imath.scale YNconstant = 1000
imath.pi2 YNconstant = 6283
imath.pi YNconstant = 3142
imath.pi_2 YNconstant = 1517
imath.muldiv YNa*b/c
imath.mul YNa*b
imath.div YNa/b
imath.rad YNrad -> deg
imath.deg YNdeg -> rad
imath.sinr YNsin(rad)
imath.cosr YNcos(rad)
imath.tanr YNtan(rad)
imath.asinr YNarcsin(rad)
imath.acosr YNarccos(rad)
imath.atanr YNarctan(rad)
imath.polr YNr, rad_alpha = pol(x, y)
imath.recr YNx, y = rec(r, rad_alpha)
imath.sind YNsin(deg)
imath.cosd YNcos(deg)
imath.tand YNtan(deg)
imath.asind YNarcsin(deg)
imath.acosd YNarccos(deg)
imath.atand YNarctan(deg)
imath.pold YNr, deg_alpha = pol(x, y)
imath.recd YNx, y = rec(r, deg_alpha)
imath.pow YNx^y
imath.log YNlog(x)
imath.log2 YNlog2(x)
imath.log10 YNlog10(x)
imath.sqrt YNsquare root
imath.int YNinteger
imath.frac YN fractal
imath.ceil YN ceil
imath.floor YNfloor
imath.round YNround

Around Wikia's network

Random Wiki