Remote script - need a nudge in the right direction - Script Writing - CHDK Forum supplierdeeply

Remote script - need a nudge in the right direction

  • 1 Replies
  • 1481 Views
Remote script - need a nudge in the right direction
« on: 10 / September / 2009, 06:28:30 »
Advertisements
Hey, I'm attempting my first script and I found one online that I figured I'd modify to suit my needs. The one I'm editing is meant to do different things depending on how long the remote button is pressed.

original script
1. Short press turn camera on, extend the lens.
2. Short press will take a picture
3. A bit longer press will take a picture with flash (if flash is lifted)
4. Looong press (>4 seconds) will turn camera off.

Code: [Select]
@title Remote button
if get_autostart then
  sleep 2000
  set_autostart 0
  press "shoot_half"
  sleep 500
  release "shoot_half"
endif
do
  do
    a = get_usb_power
  until a>0
  if a<50 then
    shoot
  else   
    if a>400 then
      shut_down
    else
      set_prop 16 2
      shoot
      set_prop 16 0
    endif
  endif
until is_key "set"
end

Now since my SD1100 isn't able to wakeup from usb I got rid of that portion. What I want to have happen is this
1. Short press will take a photo
2. Longer press but <4 seconds put the camera into custom timer (preset by user for 3 shots, bracketing in continous mode already enabled in CHDK by user)
3. Longer than a 4 second press shutdown (I may just change this to exit the script later)
working=regular not working=bold

Here is my code, I've commented it for this forum post but my real code doesn't have the //comments.

Code: [Select]
@title remote bracketing
set_prop 223 2  //sets the timer mode to custom
do
  do
    a = get_usb_power
   until a>0
   if a<50 then
      shoot
   else
     if a>400 then
       shut_down
     else   
       set_prop 102 3  //sets drive mode to timers
       shoot
       set_prop 102 0 //resets drive mode back to single
     endif
   endif
until is_key "set"
end

Am I using the set_prop command wrong? Is it just possible that the SD1100IS (IXUS80) doesn't respond to these property case values? I got the values from http://chdk.wikia.com/wiki/PropertyCase under the DIGIC III/IV table.

Any help would be greatly appreciated :)

Re: Remote script - need a nudge in the right direction
« Reply #1 on: 11 / September / 2009, 04:49:04 »
Remember, just because you can read a property-case does not mean that setting it will have any effect.
Setting shooting mode using the above method will not work.
Instead, 'press' the various buttons in your script to have the same effect as manually selecting custom-timer mode.
You will need a slight delay after every press.

 

Related Topics