Hi all,
First post so please go easy on me!
I have an odd requirement - I fly my A570IS on high altitude balloons that go up into near space and take fantastic photos. For my next flight I have decided to do something different which really pushes the limits of the CHDK.
Basically, I want to continually take photos every 10 or so seconds, however when a "power pulse" is received (via usb) from my micro controller it will take a ~10 second video. Then switch back to taking stills.
I'm using this -
http://www.zenoshrdlu.com/kapstuff/zchdk.html as it supports switching between still and video mode.
I have wrote a sample script (that doesn't include all the waits etc atm because I am just debugging). As the CHDK doesn't support interrupts (as far as I'm aware) that would allow switch to video mode as SOON as a "power pulse" is received; I have had to adopt the approach of continually polling the usb port using "get_usb_power".
However, I am getting very odd behaviour, initially when testing I was getting about 4 stills taken before it stopped and displayed "STACK FUL" - why is it saving photos onto the stack?!?
Now I am getting it halting after about 5 photos and the screen black (which is to do with the initial settings change) - but going completely unresponsive!
Code:
rem HABE2 A570 CHDK Script
rem VERSION 2.0
rem FOR CAMERA A570IS
rem Switches between stills and video
@title HABE2 2.0
rem Script to test varying between still & video mode
@param a Shoot count
@default a 1500
@param b Interval (Minutes)
@default b 0
@param c Interval (Seconds)
@default c 25
d=700
rem reset camera
sleep d
click "menu"
sleep d
click "right"
sleep d
click "up"
sleep d
click "set"
sleep d
click "right"
sleep d
click "set"
sleep 3000
rem power settings (auto shut down off & display off 30s)
sleep d
click "menu"
sleep d
click "right"
sleep d
click "down"
sleep d
click "down"
sleep d
click "down"
sleep d
click "down"
sleep d
click "set"
sleep d
click "right"
sleep d
click "down"
sleep d
click "left"
sleep d
click "menu"
sleep d
click "menu"
rem set menu values
sleep d
click "menu"
sleep d
click "down"
sleep d
click "down"
sleep d
rem digital zoom off
click "right"
sleep d
click "down"
sleep d
click "down"
sleep d
rem red-eye off
click "right"
sleep d
click "down"
sleep d
rem safety FE off
click "right"
sleep d
click "down"
sleep d
rem MF-Point Zoom off
click "right"
sleep d
click "down"
sleep d
rem Safety MF off
click "right"
sleep d
click "down"
sleep d
rem AF-Assist Beam off
click "right"
sleep d
click "down"
sleep d
rem Review off
click "left"
sleep d
click "down"
sleep d
click "down"
sleep d
rem IS Mode = shoot only
click "right"
sleep d
click "menu"
sleep d
rem set apeture to f4
sleep d
click "left"
rem select manual focus
sleep d
click "down"
sleep d
click "down"
sleep d
click "down"
rem set focus to infinity
for n=1 to 7
sleep d
click "right"
next n
rem set jpeg compression to minimal or superfine
sleep d
click "set"
sleep d
click "up"
sleep d
click "up"
sleep d
click "left"
sleep d
click "set"
rem ** Sleep for ~17mins - Should give enough time to put lid on payload/prepare for launch etc.. **
rem ** 17mins = 10 x 60 x 1000 = 1,000,000
rem sleep 999999
sleep 3000
click "display"
click "display"
:loop
x = get_usb_power
if x < 15 then gosub "still"
if x > 15 then gosub "video"
if x > 30 then print "error"
:still
sleep 1000
rem take a picture
shoot
sleep 1000
gosub "loop"
:video
print "Movie"
press "dm_movie"
sleep 1000
press "shoot_full"
sleep 300
release "shoot_full"
rem start of video delay loop
sleep 5000
rem shoot again to turn video off
press "shoot_full"
sleep 300
release "shoot_full"
sleep 1000
release "dm_movie"
gosub "loop"
rem END OF SCRIPT
If anyone could help me out I would really appreciate it!
Many thanks