Thread Tools
May 11, 2008, 03:00 PM
Recreational Engineer
Tom Harper's Avatar
Thread OP
Discussion

CHDK Intervalometer - Help!


Ok - I read all the web sites, downloaded the files, put them on my SD memory, Booted up the modified firmware, found my file and loaded it, the file name is displayed on the LCD, but nothing happens (I even read the instructions).

I want to have a simple interval program that clicks the shutter every 5.25 seconds. The program is:

1 for n = 1 to 200
2 sleep 5250
3 shoot
4 next n
5
6 end

I think it should start when I press the shutter button and stop when it takes 200 images or the shutter is pressed again - I think.

What's wrong?

Canon A710IS Fw 1.00 a

Tom
Sign up now
to remove ads between posts
May 11, 2008, 03:51 PM
Happy landings
One error I spot right away is that you sleep for 5250 ms and then assume that shoot will return in 0 ms! If you want perfect 5,25 seconds intervals you must deduct the amount of time the shoot takes from the sleep amount. BTW: Are you sure that the sleep function takes its input in ms?
May 11, 2008, 04:25 PM
Recreational Engineer
Tom Harper's Avatar
Thread OP
Paul,

Good point, but I'm not worried about accuracy yet - just want to make it go. The examples and tutorials show the time in ms. So, 1000 = 1 second.

It looks like the program never starts. Is there some magic involved? Like a button other than the shutter button that has to be pushed?

Tom
May 11, 2008, 04:49 PM
Happy landings
Quote:
Originally Posted by Tom Harper
Paul,

Good point, but I'm not worried about accuracy yet - just want to make it go. The examples and tutorials show the time in ms. So, 1000 = 1 second.

It looks like the program never starts. Is there some magic involved? Like a button other than the shutter button that has to be pushed?

Tom
The shutter button should start the program as far as I know. Have you tried writing an even simpler script? Try switching the sleep and shutter commands so you can rule out any problems with the sleep function..
May 11, 2008, 06:58 PM
Recreational Engineer
Tom Harper's Avatar
Thread OP
Paul,

I'll try blinking a character on the LCD. Might be an easier debug.

Tom
May 11, 2008, 07:13 PM
Registered User
Why not just use of of the already written scripts? You don't have to modify the one I used, just a setting in the menu to get different times.
May 11, 2008, 11:14 PM
Recreational Engineer
Tom Harper's Avatar
Thread OP
This is just a segment of a more complex script.

Do you have a copy of the one you mention?

Tom
May 12, 2008, 02:29 AM
Registered User
Quote:
Originally Posted by Tom Harper
This is just a segment of a more complex script.

Do you have a copy of the one you mention?

Tom
Hey Tom, why don't you post the whole script, so we can take a look? Also, what are you trying to do?

Cheers,
Nick
Last edited by nikivan; May 12, 2008 at 02:59 AM.
May 12, 2008, 02:32 AM
Kite flying SCRAPS member
GliderGuideMan's Avatar
Tom

Here is one intervalometer script, it works perfectly on on A620:

Code:
 rem Author - Keoeeit
rem Written for S-Series
rem Should be okay on others
rem Use Endless mode with caution
rem See documentation for important info
@title Ultra Intervalometer
@param a Delay 1st Shot (Mins)
@default a 0
@param b Delay 1st Shot (Secs)
@default b 0
@param c Number of Shots
@default c 5
@param d Interval (Minutes)
@default d 0
@param e Interval (Seconds)
@default e 0
@param f Interval (10th Seconds)
@default f 5
@param g Endless? No=0 Yes=1
@default g 0
 
p=a*60000+b*1000
t=d*60000+e*1000+f*100
if c<1 then let c=5
if t<100 then let t=100
if g<0 then let g=0
if g>1 then let g=1
if p<0 then let p=0
z=t*c
y=p+z
 
print "1 Cycle Time:", y/60000; "min", y%60000/1000; "sec"
 
goto "interval"
 
:interval
if p>0 then gosub "pause"
print "Shot 1 of", c
shoot
for n=2 to c
sleep t
print "Shot", n, "of", c
shoot
next n
if g=1 then goto "interval" else end
 
:pause
n=(a*60)+b
for m=1 to n
q=n-m
print "Intvl Begins:", q/60; "min", q%60; "sec"
sleep 930
next m
return
Cheers
DaveB...>
Last edited by GliderGuideMan; May 12, 2008 at 02:54 AM.
May 12, 2008, 06:30 AM
Recreational Engineer
Tom Harper's Avatar
Thread OP
Nick & Dave,

What's the extension on your files .txt or .bas?

Tom
May 12, 2008, 09:49 AM
Kite flying SCRAPS member
GliderGuideMan's Avatar
Tom,

.bas (file saved from notepad as all files). Could that be your problem, even though you are saving as a .bas, Windows is also adding a .txt as you have save as 'text file' rather than all files?

Cheers
DaveB...>
May 12, 2008, 05:16 PM
Recreational Engineer
Tom Harper's Avatar
Thread OP
Dave,

I added a @title line and declared the variable 'a' then changed the loop index to 'a'.

The code is now:

[email protected] Intervalometer
[email protected] a
[email protected] a 1
4for a=1 to 200
5 shoot
6 sleep 5250
7next a
8end

It is not reading the code because the file name is displayed instead of the title line.

I also get a red message on the LCD "UBASIC:1 Ukn stat"

I assume that is an error message that means 'Error line 1 unknown statement'.

So, I must be doing something wrong in the script header.

Tom
May 12, 2008, 05:38 PM
Recreational Engineer
Tom Harper's Avatar
Thread OP
It may be that it only works with declared variables (although a,b,c are declared by default) so I changed the code to use declared variables.

[email protected] Intervalometer
[email protected] a
3let a=1
[email protected] b
5let b=150
6for a=1 to b
7shoot
8sleep 5250
9next a
10end

Still hangs up on line 1.

Tom
May 12, 2008, 05:44 PM
Recreational Engineer
Tom Harper's Avatar
Thread OP
Dave,

I loaded your code and it runs great. I will see if I can account for the difference.

Thanks,

Tom
May 12, 2008, 06:05 PM
Kite flying SCRAPS member
GliderGuideMan's Avatar
Tom,

Is the line numbering in your script or are you using it for illustration - the version of UBasic used for camera scripting does not support line numbering I saw a statement on the CHDK Wiki
Quote:
Labels: This version of uBasic doesn't support line numbers. Instead, labels are used. A label must be the only statement in a line and start with a colon(:).
Could that be it?

Thanks
DaveB...>


Quick Reply
Message:

Thread Tools