key press question - General Help and Assistance on using CHDK stable releases - CHDK Forum supplierdeeply

key press question

  • 17 Replies
  • 3264 Views
key press question
« on: 11 / June / 2022, 03:01:19 »
Advertisements
@reyalp

Hope you can help.

On the M3 we have a jog wheel and thus I can use wheel_right and wheel_right to simulate me activating the jog dial to change exposure, eg when I'm finding an ETTR exposure. It's slow, but works.

On the M10 I don't have a jog wheel and thus I can't use wheel_right etc.

I thought I might be able to use/detect the M10 dial that changes shutter and aperture, but I can't work out how to do this, ie in ALT mode simulate clicking/rotating that dial.

Any thoughts/ideas gratefully received ;-)

Cheers

Garry
« Last Edit: 11 / June / 2022, 03:19:03 by pigeonhill »

*

Offline srsa_4c

  • ******
  • 4451
Re: key press question
« Reply #1 on: 11 / June / 2022, 05:08:30 »
On the M10 I don't have a jog wheel and thus I can't use wheel_right etc.
Have you tried?
The camera does not have a jog wheel but it does have that rotating ring around the shutter button. The wheel commands do work on that.

Re: key press question
« Reply #2 on: 11 / June / 2022, 05:30:34 »
I did try, but maybe not hard enough.


I’ll have another look  ;)

Re: key press question
« Reply #3 on: 11 / June / 2022, 05:39:00 »
@srsa_4c

Confirmed, that the following function crashes the M10, but runs OK on the M3.


The M10 freezes, so I can’t look at the console.

Code: [Select]
function set_ETTR()
    local histo={}
    local total = 0
    histo,total=get_live_histo()
    total = 0
    local max = #histo
    local start = max-hlw
    for i = start,(max-1),1 do total = total + histo[i] end -- get the total count in the requested quartiles

    press("shoot_half")
    repeat sleep(10) until get_shooting()
    s = get_tv96()
    set_user_tv96(s)
    release("shoot_half")
    repeat sleep(10) until (not get_shooting())

    if total > 0 then -- overexposed
        i = 0
        repeat
            wheel_right() -- move 1 stop, but note camera must be set to 1/3 stops
            wheel_right()
            wheel_right()
            histo,total=get_live_histo()
            total = 0
            for i = start,(max-1),1 do total = total + histo[i] end
        until total <= 0
        repeat
            wheel_left()
            histo,total=get_live_histo()
            total = 0
            for i = start,(max-1),1 do total = total + histo[i] end
        until total > 0
        wheel_right()
    elseif total <= 0 then -- underexposed
        i = 0
        repeat
            wheel_left() -- move 1 stop, but note camera must be set to 1/3 stops
            wheel_left()
            wheel_left()
            histo,total=get_live_histo()
            total = 0
            for i = start,(max-1),1 do total = total + histo[i] end
        until total > 0
        repeat
            wheel_right()
            histo,total=get_live_histo()
            total = 0
            for i = start,(max-1),1 do total = total + histo[i] end
        until total <= 0
    end

    return
end
« Last Edit: 11 / June / 2022, 05:59:01 by pigeonhill »


*

Offline srsa_4c

  • ******
  • 4451
Re: key press question
« Reply #4 on: 11 / June / 2022, 06:51:28 »
the following function crashes the M10
Is that an actual crash (cam powers off), or a freeze (camera on but unresponsive)? If the former, can you get a romlog?

Which shooting mode does your script expect? Since the camera only has that one ring to adjust things, one must use the "up" button to switch between various controls (Av, Tv, shutter speed or exposure compensation) when the current shooting mode has more than one of them.

Re: key press question
« Reply #5 on: 11 / June / 2022, 07:10:06 »
the following function crashes the M10
Is that an actual crash (cam powers off), or a freeze (camera on but unresponsive)? If the former, can you get a romlog?

Which shooting mode does your script expect? Since the camera only has that one ring to adjust things, one must use the "up" button to switch between various controls (Av, Tv, shutter speed or exposure compensation) when the current shooting mode has more than one of them.

@srsa_4c

Cam freezes then 'crashes' to a black screen.

The Cam is in M mode and MF. The script tests for this.

I have looked in the log folder, but no romlog.

*

Offline srsa_4c

  • ******
  • 4451
Re: key press question
« Reply #6 on: 11 / June / 2022, 07:15:32 »
I have looked in the log folder, but no romlog.
Miscellaneous stuff -> Debug parameters -> Save ROM crash log
The romlog (ROMLOG.LOG) will appear in card root. Upload it please.

Re: key press question
« Reply #7 on: 11 / June / 2022, 07:27:55 »


*

Offline srsa_4c

  • ******
  • 4451
Re: key press question
« Reply #8 on: 11 / June / 2022, 07:42:01 »
Too large to cut and past:
You can also attach smaller files here, no need to inline them.

Can you try adding some sleep (say, 10 ms) between "wheel" rotations?

Re: key press question
« Reply #9 on: 11 / June / 2022, 07:55:51 »
Too large to cut and past:
You can also attach smaller files here, no need to inline them.

Can you try adding some sleep (say, 10 ms) between "wheel" rotations?

That seems to help :-)

But why? OK on the M3.

The script is still playing up, but Cam not crashing.

At the moment the script assumes Cam set to 1/3 stops, but I can't see how to do that, vs 1/2 Ev, on the M10. Need to keep tweaking the script for the M10.

Thanks for getting me a little bit closer to a functioning script.

UPDATE: Script now runs on both M3 and M10, as expected. Thanks @srsa_4c :-)
« Last Edit: 11 / June / 2022, 09:21:14 by pigeonhill »

 

Related Topics


SimplePortal 2.3.6 © 2008-2014, SimplePortal