Tuesday, April 29, 2008

CHDK Scripts

Though CHDK provides a robust set of tools out of the box, some things it provides are best left to scripting for greater control and customization. That said, using the scripting functions is a simple process and can prove to be invaluable. You can do bracketing (the camera, by default, only allows a maximum of 2 EV's and 3 shots), motion detection, and more. Below is a tutorial on how to load a script, set its paramters and get it going.
  • To get to the scripting, select scripting parameters from the main menu;
  • The main script screen always shows the last loaded script and its parameters in the last section;
  • To load a script, select Load Script from File;
  • A file browser opens to allow you to select the script file. The scripts are a loose similarity to BASIC and therefore have a .bas extension. The ~1 in the files are just because the filename is too large, so it shortens it;
  • I selected the MD_TEST2.BAS file. This is a motion detection test file;
  • Once the file is loaded (by pressing SET on your camera after selecting the file), the main screen returns and shows the parameters required as defined in the script itself. Set the options as desired (a tutorial on motion detection to come soon), then press the menu button on your camera. You'll notice it shows the script name in the bottom left of the screen (in rec mode, not shown in playback mode). Without exiting ALT mode, press the shutter button to execute the script and it will run;

No comments: