Ultimate Intervallometer - Autostart MacroMode - Script Writing - CHDK Forum supplierdeeply

Ultimate Intervallometer - Autostart MacroMode

  • 8 Replies
  • 4981 Views
Ultimate Intervallometer - Autostart MacroMode
« on: 12 / July / 2016, 15:12:10 »
Advertisements
Hey there

Please apologise my english, it is not my mother language.

I will use the UI skript for a long term (10 days) timelaps.
The camera (an old Powershot G7) will not be touchable in this time.
So everything hast to work, if the power is switcht on :-)

On the cam, i mounted (DIY) a 0.4 wide-angle converter.
The only way to get a focused image is to use the macro mode.

But how can i do this automatically?

Things i tried, but dont work:

Use the C1 (custom mode on the wheel) whre i saved the macromode.
But when the skript starts, th ecam return into the P-mode.

I "hacked" the UI-skript by changing the INFINITY value to 100 (must be 10cm?)
But the cam still dont give me an sharp picture.

What else can i try?

*

Offline reyalp

  • ******
  • 14117
Re: Ultimate Intervallometer - Autostart MacroMode
« Reply #1 on: 12 / July / 2016, 16:14:30 »
You could try to enter macro mode by sending key presses from script. From the manual it looks like the left arrow key brings up the macro/normal selector. So assuming it always starts in normal clicking left twice (or once? exact behavior isn't clear to me) should do it. You might need a small delay between clicks.

You would need to do this after entering shooting mode, and I'd suggest a small delay if you put it right after the switch.
Don't forget what the H stands for.

*

Offline msl

  • *****
  • 1280
  • A720 IS, SX220 HS 1.01a
    • CHDK-DE links
Re: Ultimate Intervallometer - Autostart MacroMode
« Reply #2 on: 12 / July / 2016, 16:33:50 »
As I wrote in the german forum and now also reyalp, make a loop for the macro key (I think it is click "left" for the G7) and call 'get_focus_mode'. The result for the macro mode must be 4.

This is the one and only way turn on the macro mode via script.

e.g.
Code: [Select]
repeat
click("left")
sleep(500)
until get_focus_mode == 4

Play with the value for sleep.

msl
CHDK-DE:  CHDK-DE links

Re: Ultimate Intervallometer - Autostart MacroMode
« Reply #3 on: 12 / July / 2016, 16:44:01 »
Hey reyalp

Thanks for the quick reply.

I think i understand the way you want to so solve my problem.
But i am not expirienced enough to do this.

Would you give me an example?

If you have no time, is this the beginning of the shooting mode?

    -- switch to shooting mode as script start defaults to DAY mode
    switch_mode(SHOOTING)
    show_msg_box("...starting")

Thanks a very lot

kolja


*

Offline reyalp

  • ******
  • 14117
Re: Ultimate Intervallometer - Autostart MacroMode
« Reply #4 on: 12 / July / 2016, 17:57:15 »
If you have no time, is this the beginning of the shooting mode?

    -- switch to shooting mode as script start defaults to DAY mode
    switch_mode(SHOOTING)
    show_msg_box("...starting")

I don't know without spending some time looking at the script. If you want to be sure you are in macro every time the camera goes to shooting mode, you could add the code msl posted to the switch mode function, like

Code: [Select]
function switch_mode( psmode )   -- change between shooting and playback modes
    if ( psmode == SHOOTING) then
        if ( get_mode() == false ) then
            set_record(true)                                            -- switch to shooting mode
            wait_timeout( get_mode, true, 10000, "fault on switch to shooting mode")
            sleep(2000)                                                 -- a little extra delay so things like set_LCD_display() don't crash on some cameras
-- added code to switch to macro mode
repeat
click("left")
sleep(500)
until get_focus_mode == 4
--
        end
    else
        if ( get_mode() == true ) then
            set_record(false)                                           -- switch to playback mode
            wait_timeout( get_mode, false, 10000, "fault on switch to playback mode")
            sleep(2000)                                                 -- a little extra delay so things like set_LCD_display() don't crash on some cameras
        end
    end
end

I haven't tested this.
Don't forget what the H stands for.

Re: Ultimate Intervallometer - Autostart MacroMode
« Reply #5 on: 18 / July / 2016, 09:47:25 »
Hey

In the german board, Werner give me some code,
whitch io extended with one if-statement.

Code: [Select]
-- added code to switch to macro mode
print(get_focus_mode)
if get_focus_mode ~= 4 then
click("left") -- Gehe in die Makromodus-Einstellungen
sleep(200)    -- Zwangspause im Skript von 200 ms (nur zur Sicherheit)

click("left") -- Wähle die Einstellung Makromodus aus (1x nach links in diesem Menü)
sleep(200)    -- Zwangspause im Skript von 200 ms (nur zur Sicherheit)

click("set")  -- Aktiviere den Makromodus via SET
sleep(200)    -- Zwangspause im Skript von 200 ms (nur zur Sicherheit)

end
-- 

Without the if get_focus_mode the cam switches between the macro and the normal mode.
first pic macro, second normal, third macro ....

But the cam does ist even with the if get_focus_mode.
What did i wrong?

Re: Ultimate Intervallometer - Autostart MacroMode
« Reply #6 on: 18 / July / 2016, 12:30:29 »
OK, i forgott this ()

This code works fine for me:

Code: [Select]
-- added code to switch to macro mode
if get_focus_mode() ~= 4 then
click("left") -- Gehe in die Makromodus-Einstellungen
sleep(200)    -- Zwangspause im Skript von 200 ms (nur zur Sicherheit)

click("left") -- Wähle die Einstellung Makromodus aus (1x nach links in diesem Menü)
sleep(200)    -- Zwangspause im Skript von 200 ms (nur zur Sicherheit)

click("set")  -- Aktiviere den Makromodus via SET
sleep(200)    -- Zwangspause im Skript von 200 ms (nur zur Sicherheit)

end
-- 

Re: Ultimate Intervallometer - Autostart MacroMode
« Reply #7 on: 18 / July / 2016, 12:37:34 »
That code makes the assumption that two left clicks followed by a "set" will put the camera into macro focus mode.  That may not work for every camera and will depend on the current focus mode when the script starts.  A better algorithm would be to click and loop until the desired focus mode is achieved.
Ported :   A1200    SD940   G10    Powershot N    G16


*

Offline c_joerg

  • *****
  • 1251
Re: Ultimate Intervallometer - Autostart MacroMode
« Reply #8 on: 19 / July / 2016, 03:26:58 »
A better algorithm would be to click and loop until the desired focus mode is achieved.
As msl described in Reply #2...
M100 100a, M3 121a, G9x II (1.00c), 2*G1x (101a,100e), S110 (103a), SX50 (100c), SX230 (101a), S45,
Flickr https://www.flickr.com/photos/136329431@N06/albums
YouTube https://www.youtube.com/channel/UCrTH0tHy9OYTVDzWIvXEMlw/videos?shelf_id=0&view=0&sort=dd

 

Related Topics


SimplePortal 2.3.6 © 2008-2014, SimplePortal