Using bracketing script with USB remote - Script Writing - CHDK Forum  

Using bracketing script with USB remote

  • 7 Replies
  • 3623 Views
Using bracketing script with USB remote
« on: 28 / May / 2008, 17:54:57 »
Advertisements
I have successfully adapted Nichloas Bertolissio's bracketing script to work on the SD870.  It begins taking photos by pressing the "set" button.  I want it to work so that it begins taking photos each time it receives a USB pulse.

The full USB remote and bracketing scripts I'm using are listed at the bottom of this post.  If anybody can figure out how to make this would I appreciate it greatly.

I changed the following statement in the bracketing script hoping it would work, but it didn't:

if is_key "set"   

changed to:

if is_key "remote"


I have been using the following USB remote script:

@title Remote button
while 1
  wait_click 1
  if is_key "remote" then shoot
wend

end


Below is the full bracketing script that I want to change so that it starts each time it receives a USB pulse:

@title Bracketing
@param a (Number images-1)/2   1..12
@default a 1
@param b Step size  (1/3 EV)   1..12
@default b 2
@param c Correction (1/3 EV) -12..12
@default c 0

get_prop 25 w
get_prop 26 x

let y=1

do
  let z=0

  do
    if a<1   then let a=1
    if a>12  then let a=12
    if b<1   then let b=1
    if b>12  then let b=12
    if c<-12 then let c=-12
    if c>12  then let c=12
    if y<1 then y=3
    if y>3 then y=1

    print ""
    if y=1 then print "Num : <" 2*a+1 ">"     else print "Num :  " 2*a+1
    if y=2 then print "Step: <" b/3,b%3 "/3>" else print "Step:  " b/3,b%3 "/3"
    if y=3 then print "Corr: <" c/3,c%3 "/3>" else print "Corr:  " c/3,c%3 "/3"
    print "[Set]=shoot [Disp]=exit"

    wait_click
    if is_key "up"   then let y=y-1
    if is_key "down" then let y=y+1
    if y=1 and is_key "left"  then let a=a-1
    if y=2 and is_key "left"  then let b=b-1
    if y=3 and is_key "left"  then let c=c-1
    if y=1 and is_key "right" then let a=a+1
    if y=2 and is_key "right" then let b=b+1
    if y=3 and is_key "right" then let c=c+1
    if is_key "set"     then z=1
    if is_key "display" then z=2
  until z>0
  if z=2 then goto "exit1"

  let d=c*32-a*b*32

  for s=1 to 2*a+1
    set_prop 107 d
    set_prop 207 d
    print "Shoot at",d/96,(d/32)%3 "/3"
    do
      get_prop 206 p
    until p=0
    press "shoot_full"
    do
      get_prop 206 p
    until p=1
    release "shoot_full"
    let d=d+b*32
  next s
 
  :exit1
until z=2

set_prop 25 w
set_prop 26 x

end

Thanks in advance!!
 


*

Offline zeno

  • *****
  • 889
Re: Using bracketing script with USB remote
« Reply #1 on: 28 / May / 2008, 18:16:10 »
Michael

the simplest way to wait for power to be applied to the usb port is this:
Code: [Select]
do
      a = get_usb_power
until a>0
The do loop will not exit until power is applied (or the shutter button is pressed to interrupt the script)

Dave
A570, S100, Ixus 127
Author of ASSIST, STICK, WASP, ACID, SDMInst, LICKS, WICKS, MacBoot, UBDB, CFGEdit

Re: Using bracketing script with USB remote
« Reply #2 on: 28 / May / 2008, 18:24:43 »
Thanks for your reply, Dave.

Sorry for my ignorance, but will the "a" in your statements interfere with the "a" in the bracketing script?  Also, I want it to be able to repeat the bracketing each time it gets a pulse.  This may happen 500 or more times during a session.  This currently works in the bracketing script each time I press "set".

I appreciate the help!

Re: Using bracketing script with USB remote
« Reply #3 on: 28 / May / 2008, 19:08:29 »
You should use a different variable if 'a' is already used


Re: Using bracketing script with USB remote
« Reply #4 on: 28 / May / 2008, 19:32:17 »
I tried a different variable, but it didn't work.  The scripts each have wait_click statements too, so they may be conflicting also.  I tried a few things, but my skills weren't up to the task.

*

Offline zeno

  • *****
  • 889
Re: Using bracketing script with USB remote
« Reply #5 on: 29 / May / 2008, 04:59:05 »
Michael - see my post in the KAP Forum at KAP Discussion Page - CHDK script help needed
A570, S100, Ixus 127
Author of ASSIST, STICK, WASP, ACID, SDMInst, LICKS, WICKS, MacBoot, UBDB, CFGEdit

Re: Using bracketing script with USB remote
« Reply #6 on: 29 / May / 2008, 16:12:28 »
Shortest script :)
do
until get_usb_power

But note, get_usb_power returns when you 'lift' the button not when pressing it. (It will return the length of the press).

Re: Using bracketing script with USB remote
« Reply #7 on: 30 / May / 2008, 05:07:24 »
Hi, Michael L.

Well, I'm not quite sure that what I'm going to give you is what you want, but maybe it could help you.
When I discovered CHDK, I wanted a script that would allow me to shoot a burst with the remote control. Finally, after hours an hours playing around and trying to write that script (as I didn't know anything about programmation!), I succeeded to do what I wanted. Thanks to this script, the camera starts shooting a burst when I press the remote button, and it stops when I press it again. All I have to do is to set the camera on continuous mode. And now, thanks to Allbest's build, that allows me to set "bracketing in continous mode", I can use the Av or Tv bracketing the same way. And it works very good!
Now, I have a A630 and dunno if it will work with your cam, but let's give it a try and then tell me if it works!
Hope I helped.


 

Related Topics