chdk

CHDK allows you to automate your camera by running "scripts" - small and simple programs written by end-users and executed on the camera. Currently, CHDK allows you to use scripts written in Lua (file names: *.lua) and uBASIC (file names: *.bas). The file extension indicates how the script should be parsed. There are scripts for many applications like for exposure bracketing, focus bracketing, intervalometers and more available here : User Written Scripts

Running a script

 The Script Menu

The Script Menu

 Running a Script - Exposure Bracketing

Running a Script - Exposure Bracketing

Overview

Running a Lua script

Running a uBASIC script

Differences between Lua and UBASIC

uBASIC was the first scripting language supported in CHDK. Lua came later and can be found in every CHDK build released since the year 2008. In general, Lua scripts will run faster and provide more features than uBASIC but the Lua language is not as well known as the many variants of BASIC.

Useful Links

Programming in uBASIC

Programming in Lua

Setting up a Development Environment

For help setting up a uBASIC development environment see UBASIC/TutorialScratchpad and UBDebug

For help in setting up a Lua development environment, see Lua Development Environment.

Using these tools, scripts can be tested locally on your PC prior to being uploaded to your camera.

Other Notes

You may wish to build CHDK without some components to increase the available memory on the camera.

Tip for Those Who Can't Stop a Script from Automatically Running Every Time They Turn on CHDK

If you cant 'stop' a script from running or 'unload' it, you can connect your memory card to your computer and rename script that is auto running (example: from interv.lua to interv1.lua)

If this doesn't work, you can also stop the script, then press the <alt> button, then go to the "scripts" menu, and change "Autostart" to "off".