set_zoom at startup (noob) - Script Writing - CHDK Forum supplierdeeply

set_zoom at startup (noob)

  • 13 Replies
  • 3549 Views
set_zoom at startup (noob)
« on: 18 / July / 2012, 06:00:51 »
Advertisements
Hello,

I would like to set the zoom level at startup, automatically. I'm using an IXUS 115HS.

Using the following script, everything works just fine but, once the script ends, the zoom lever doesn't work anymore.

Am I doing something wrong?

Code: [Select]
sleep 500
set_zoom 3
sleep 500
exit_alt 0
end

(sorry for the newbee question, but this is my first script and I'm not a programmer)

*

Offline msl

  • *****
  • 1263
  • A720 IS, SX220 HS 1.01a
    • CHDK-DE links
Re: set_zoom at startup (noob)
« Reply #1 on: 18 / July / 2012, 07:09:37 »
This script works for me:
Code: [Select]
@title zoom start

sleep 1000
set_record 1
sleep 2000
set_zoom 3
sleep 1000
exit_alt
end

Press the power button. Camera starts in playback mode. 'set_record 1' switches to shooting mode. (don't know if this command works for the ixus115). You can play with sleep values.

msl
CHDK-DE:  CHDK-DE links

Re: set_zoom at startup (noob)
« Reply #2 on: 18 / July / 2012, 07:32:55 »
Thank you for trying to help.

Both scripts run just fine but, upon completion, the camera is ready to shoot but the zoom lever doesn't function anymore.

Do you think that it could be specific to this model?

*

Offline msl

  • *****
  • 1263
  • A720 IS, SX220 HS 1.01a
    • CHDK-DE links
Re: set_zoom at startup (noob)
« Reply #3 on: 18 / July / 2012, 07:48:27 »
Maybe it's a porting problem.

We could add a command to test the zoom lever.

Code: [Select]
@title zoom start

sleep 1000
set_record 1
sleep 2000
set_zoom 3
sleep 2000
click "zoom_in"
rem click "zoom_out"
exit_alt
end

Works the zoom lever now?

msl
CHDK-DE:  CHDK-DE links


Re: set_zoom at startup (noob)
« Reply #4 on: 18 / July / 2012, 07:56:09 »
Unfortunately, no. It bombs the camera; had to take out the battery.

Maybe a porting problem indeed.

Re: set_zoom at startup (noob)
« Reply #5 on: 18 / July / 2012, 08:12:18 »
Unfortunately, no. It bombs the camera; had to take out the battery.

Very strange.  Does this also crash the camera :
Code: [Select]
@title zoom start
click "zoom_in"
end

Test it as a normal script and as a startup script ?

Update :  things to check about this port : at one time,  originally the default <ALT> key sequence was DISP+ZOOM-IN.  Could this cause problems with ZOOM-IN in script mode.  Also,  in the keymap[],  KEY_PRINT comes after KEY_DISP and KEY_ZOOM_IN  but according to the note about order counting, combo keys like that (e.g.  KEY_SHOOT_FULL) need to come before the individual keys they are comprised of.
« Last Edit: 18 / July / 2012, 08:50:43 by waterwingz »
Ported :   A1200    SD940   G10    Powershot N    G16

Re: set_zoom at startup (noob)
« Reply #6 on: 18 / July / 2012, 16:33:43 »
Thanks for chiming in waterwingz.

No, just using click "zoom_in" doesn't crash the camera when running as a normal script, the lens do zoom in and the zoom lever does work afterwards. It doesn't run at all when set as a startup script.

Now, running any of the preceding scripts causes the camera to execute all the commands just fine but disable the zoom lever, most of the times! On some occasions it just crashes the camera after executing the commands.

 
« Last Edit: 18 / July / 2012, 16:49:33 by Rogerio »

Re: set_zoom at startup (noob)
« Reply #7 on: 18 / July / 2012, 18:27:09 »
Now, running any of the preceding scripts causes the camera to execute all the commands just fine but disable the zoom lever, most of the times! On some occasions it just crashes the camera after executing the commands.
To be clear,  it the above statement, do you mean running any of the preceding scripts "normally" (rather than as a startup script) works but disables the zoom lever ?

The set_zoom command is problematic on some cameras - in this thread :
http://chdk.setepontos.com/index.php?topic=7071.0
it was solved for some camera and not for others.

What if you run this at startup :

Code: [Select]
@title zoom start
sleep 2000
press "zoom_in"
sleep 1000
release "zoom_in"
end
Ported :   A1200    SD940   G10    Powershot N    G16


Re: set_zoom at startup (noob)
« Reply #8 on: 18 / July / 2012, 19:24:19 »
Using press "zoom_in" doesn't disable the zoom lever but… the lens go all the way to the 9th zoom step, ie, using exactly the snippet you suggest.

set_zoom works fine. If I use  set_zoom 3 or set_zoom 8, the lens goes to the 4th or 9th position respectively. But then the zoom lever doesn't work anymore.

All scripts were tried as both startup and normal scripts.

Re: set_zoom at startup (noob)
« Reply #9 on: 18 / July / 2012, 19:43:39 »
All scripts were tried as both startup and normal scripts.
So did the last script I posted work as you described in both modes ?  No crash - zooms to 90% in normal or startup mode ?   (sorry .. this is painful but the details matter a lot !)

hack : this version should get you closer to 30% zoom on startup :

Code: [Select]
@title zoom start
sleep 2000
press "zoom_in"
sleep 200
release "zoom_in"
end
Ported :   A1200    SD940   G10    Powershot N    G16

 

Related Topics