Scripting Notes - Canon CHDK User Manual

Extra features for powershot cameras
Hide thumbs Also See for CHDK:
Table of Contents

Advertisement

Scripting notes

Well! where do we start, it is well known that Scripts and Scripting deserves a manual of it's own, but
for this limited size User Guide we will have to be content with a very brief overview.
Definition of a Script: A simple program in a utility language, another term for macro or batch file.
In computer programming, a computer script is a list of commands, or instructions, that are executed by a
certain program or scripting engine. They are usually just text documents that contain instructions written
in a certain scripting language (ie: uBASIC, Lua). This means most scripts can be opened and edited
using a basic text editor. However, when opened by the appropriate scripting engine, the commands
within the script are executed.
In CHDK, scripts are used to automate a command or multiple commands to the camera in order to have
the camera perform certain actions, ie: to hold the shutter open for a particular length of time, or to force
a particular Av or ISO setting, (and many more actions). Nearly anything you can do by pressing buttons
on your camera with your own fingers, you can also do automatically with these script commands
also that many scripts are universal for all relevant cameras, while others are camera model specific.
Inventive script programmers, the experienced, and the not so experienced, have been active from the
beginning of CHDK, with many short and simple, and also the more complex scripts being made freely
available to the CHDK community. Scripts such as: motion detect, time lapse.
Here is an example script -
UBASIC/Scripts: Lightning script -- Fudgey
Written for/on: Powershot S5 IS
Also works on: A540, A550, A590 so far.
Doesn't work on: A720 IS and some others.
This is basically a very fast and responsive motion detection script. This will definitely solve your
problems if you want to catch lightning, (thus the title) or anything fast, however some objects will blur
when the light conditions are insufficient. Enjoy this script!
Script Code
(save as "Lightning script.bas" to your /CHDK/SCRIPTS / folder)
----------------------------------------------------------------------------------------------------------------------------------------------------
rem Author: fudgey - based on BarneyFife's MD Lightning6 and MLuna's Motion Detect
scripts
rem Tested on A570IS, Allbest build 16
rem For bursts, set the camera in continuous shooting mode and set j>0
rem If j>0 in single shot mode, you will see your shot for j seconds on screen.
@title Fast MD with Burst/Preview 080205
@param a Columns
@default a 6
@param b Rows
@default b 4
@param c Threshold (0-255)
@default c 10
@param d Compare Interval (ms)
@default d 1
@param e Trigger Delay (0.1 sec)
@default e 42
@param f Rows to Exclude
@default f 0
@param g Pix-Step(speed/accuracy adj)
57
.
Note

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents