Zoom lens failure in ALT mode - General Help and Assistance on using CHDK stable releases - CHDK Forum

Zoom lens failure in ALT mode

  • 7 Replies
  • 3706 Views
Zoom lens failure in ALT mode
« on: 16 / November / 2011, 11:32:23 »
Advertisements
Canon A640.  CHDK installed and operable, but, zoom lens will not function when in ALT mode.  Reading status screen (function set and display when in playback mode) indicates "zoom lens error".  Any work-around possibilities, or does this require a camera repair?  (And how do you explain to the Canon repair guy that the camera is working fine except when employing CHDK?)

*

Offline srsa_4c

  • ******
  • 4451
Re: Zoom lens failure in ALT mode
« Reply #1 on: 16 / November / 2011, 11:54:23 »
When ALT mode is active, all keys (and the zoom lever) lose their original function. Does zoom work when you get out of ALT mode (<ALT> disappears from the bottom of the LCD)?

Re: Zoom lens failure in ALT mode
« Reply #2 on: 16 / November / 2011, 13:29:39 »
Thanks for your prompt reply.  Yes, when not in ALT mode zoom lever functions as it should.  I could have sworn, however, that it used to function even when in ALT.  (This wouldn't be the first mistake I've made.)  So, this would seem to mean that I would be obliged to perform all pre-exposure manipulations in the regular mode, then enter the ALT mode to make the exposure, e.g. running a script.  If that is correct, will, for example, a script that exposes a succession of shots at varying focus points work?  (I can, of course, try this myself, but as long as we're in this area, I thought I'd ask.)

Re: Zoom lens failure in ALT mode
« Reply #3 on: 16 / November / 2011, 13:46:15 »
In short: being in ALT mode you use CHDK menu and shutter runs script, outside ALT you have Canon menus and keys work as without CHDK. That NOT means that outside ALT mode your camera behaves as without CHDK - CHDK works in background, for example when some parameters are overriden, but all your interactions with the camera using keys are just like without CHDK.

Abouts settings and scripts:

Well... a lot of things tepend on the script you like to use. For example:

-there are scripts for 'just make timelapse' - they are used to take a lot of photos. In most cases you have to set up all the exposure-related things (aperture, shutter time, ISO) being in Canon mode and then you have to go to the ALT mode and run script.

-there are other scripts (foe example bracketings) that set up some things instead of you. For example using a kind of simple shutter time bracketing you'll have to set up aperture and ISO in Canon mode and then in ALT mode run script, which automatically will change shutter time of each photo. The same corresponds with other bracketings.

The main rule is: in Canon menu you can set up whatever you like as having no CHDK. In ALT mode you can set up all the things, that CHDK can controll.

The second rule: if some settings are different (in example ISO 100 in Canon mode and ISO 300 in ALT/CHDK) the CHDK value will be used. The Canon value is (almost) always overriden by CHDK value.
if (2*b || !2*b) {
    cout<<question
}

Compile error: poor Yorick

Re: Zoom lens failure in ALT mode
« Reply #4 on: 16 / November / 2011, 14:02:29 »
So, this would seem to mean that I would be obliged to perform all pre-exposure manipulations in the regular mode, then enter the ALT mode to make the exposure, e.g. running a script.
Or you can read the zoom key status in your script and the have the script click the matching zoom_key value so that the zoom appears to function normally while running that script in <ALT> mode.

Ported :   A1200    SD940   G10    Powershot N    G16

Re: Zoom lens failure in ALT mode
« Reply #5 on: 16 / November / 2011, 14:42:07 »
My thanks to both of you.  Outslider has offered me a very helpful philosophy.
As to Waterwingz suggestion: "read the zoom key status in your script", I would indeed appreciate how that might be coded.

Although I've been fussing with CHDK for several years now, this experience of posting on the forum and receiving prompt and helpful responses is new to me, and very gratifying. 

Re: Zoom lens failure in ALT mode
« Reply #6 on: 16 / November / 2011, 19:02:30 »
You could do this in a way simmilar to this:

Code: [Select]
do
    is_key k "zoom_in"
        if k=1 then click "zoom_in"
    is_key k "zoom_out"
        if k=1 then click "zoom_out"
       (...and here some things to do meanwhile...)
    until (...here put a condition(s) when the loop ends...)

You can use others buttons as well. This code will only work if the "is_key" command runs while key is pressed. So the loop runs again and again and doesn't wait for a click. This is rather rarely used way. Most common is waiting for a click. It's used, when user must iteract with the script.

Example

Following script (in lua - I prefer this language) will wait for the pressed key. If you press zoom-in or zoom-out it zooms. When you press half-shutter it takes 5 shots.

Code: [Select]
exit_loop=false
repeat
    wait_click(0)
    if is_key("zoom_in") then click "zoom_in" end
    if is_key("zoom_out") then click "zoom_out" end
    if is_key("shoot_half") then
        exit_loop=true
        for i=1 , 5 do
            shoot()
            end
    until exit_loop==true


I'm not really sure, if there's no bugs in this code, I haven't tested it now, I just wrote it 'on-the-fly' but it at least gives you an idea, how the things work.

PS.
You might be sometimes confused seeing simmilar commands written in diffrent style, such as:

Code: [Select]
    print "hello, chdk!"

vs.

Code: [Select]
    print("hello, chdk!")

The difference is caused by the fact, that there are two scripting languages supported by CHDK - uBasic and Lua. Lua has the 'perenthesized' syntax. Lua is much more powerfull. And, IHMO, it looks better:)
if (2*b || !2*b) {
    cout<<question
}

Compile error: poor Yorick

Re: Zoom lens failure in ALT mode
« Reply #7 on: 16 / November / 2011, 20:55:04 »
Thanks outslider - saves me the trouble of posting this tonight.

One slight modification is to use set_zoom() to command the zoom position directly rather than rely on fake key presses.   This is documented here :

set_zoom problems in uBASIC & Lua scripts

although its there because it does not work on some cameras.
Ported :   A1200    SD940   G10    Powershot N    G16

 

Related Topics


SimplePortal © 2008-2014, SimplePortal