Getting exposure values from half_shoots in Av mode? - Script Writing - CHDK Forum supplierdeeply

Getting exposure values from half_shoots in Av mode?

  • 6 Replies
  • 2047 Views
Getting exposure values from half_shoots in Av mode?
« on: 17 / April / 2009, 09:44:19 »
Advertisements
I'm trying to create an interactive script that allows the user to set values, that are later used in teh script, by pointing and half_shooting manually. By that I mean my script starts, puts cam into spot-evaluation mode and says "point at object 1 and half_shoot" - it then grabs the auto-calculated exposure and stores it in a variable, then it asks you to repeat that process and stores the next one etc, then uses all that info when formulating the result afterwards. What's my best method of doing this? If I'm in Av mode I then cant set the aperture by script can I, without changing to Manual ?
« Last Edit: 17 / April / 2009, 10:01:21 by coyoteboy »

Re: Getting exposure values from half_shoots in Av mode?
« Reply #1 on: 18 / April / 2009, 19:23:56 »
BTW this is a 720is, I've tried:

wait_click
get_tv96 a
wait_click
get_tv96 b
print a,b

But it only ever returns 0,0. Removing 96 simply locks the camera up completely and it need a reboot.


Re: Getting exposure values from half_shoots in Av mode?
« Reply #2 on: 20 / April / 2009, 17:26:43 »
Am I being stupid here? No bites suggests I'm making a "newbie" error but I can't find any scripts with similar requirements in the examples so I can't identify where I'm going wrong.

*

Offline Jucifer

  • *****
  • 251
  • [A710IS]
Re: Getting exposure values from half_shoots in Av mode?
« Reply #3 on: 20 / April / 2009, 17:57:44 »
returns 0,0


try

Code: [Select]
print get_tv96
press "shoot_half"
sleep 1000
print get_tv96
sleep 1000


Re: Getting exposure values from half_shoots in Av mode?
« Reply #4 on: 22 / April / 2009, 12:34:31 »
Ahh so instructions are non-blocking in ubasic then? Thanks Jucifer - I'll attempt that tonight and see how I get on. I should have twigged this as the shoot_half gave no usual indication (focusing etc) in the hardware. I'll report back - much obliged!

*

Offline Jucifer

  • *****
  • 251
  • [A710IS]
Re: Getting exposure values from half_shoots in Av mode?
« Reply #5 on: 22 / April / 2009, 14:09:05 »
Huh?

All I know, that get_tv96 calls shooting_get_tv96... which looks like
Code: [Select]
short shooting_get_tv96()
{
    short tv96;
    _GetPropertyCase(PROPCASE_TV, &tv96, sizeof(tv96));
    return tv96;
}

. (ok, that might be a bit irrelevant...)
And this propcase (69 on digic2, 262 in digic3) seems to be updated only on shoot_half. At least on my cam.

So, if you want the "current" tv96, get it after pressing/clicking shoot_half.

By the way, if you want the script to react to user input, you could try even something like
Code: [Select]
:loop_collect_data
  wait_click
  if is_key "shoot_half" then gosub "focus_and_get_tv96"
  if is_key "down" then goto "done_collecting"
  goto "loop_collect_data"
. Also, consider using Lua.

Then there's is_pressed...
Code: [Select]
:loop
  if is_pressed "up" then a=a+1
  if is_pressed "down" then a=a-1
  print a
  goto "loop"


'nuff confused.
« Last Edit: 22 / April / 2009, 14:11:35 by Jucifer »

Re: Getting exposure values from half_shoots in Av mode?
« Reply #6 on: 22 / April / 2009, 16:19:20 »
here's a lua function which i created to solve the problem. could probably be converted to ubasic.

Code: [Select]
function cam.getExposure()
log.print("cam.getExposure - start")

  press("shoot_half")
  repeat
    sleep(1)
  until get_shooting() == true
  release("shoot_half")
  sleep(1000)
 
  local bv=get_bv96()
local av=get_av96()

log.print("cam.getExposure - end")
  return bv, av
end

be aware that the function would need to be renamed if you're not using it as part of the cam lua lib and remove the logging code if you're not using the log lua lib.

 

Related Topics