SX200 Zoom / Autofocus - Script Writing - CHDK Forum

SX200 Zoom / Autofocus

  • 1 Replies
  • 2439 Views
SX200 Zoom / Autofocus
« on: 06 / November / 2009, 05:46:34 »
Advertisements
 Hello :)
Here is my Zoom / Autofocus

Can anyone tell me why slow zoom does not work?
Thanks

Code: [Select]
rem SX200 By Dulap
@title zoom / focus in video

s=15
z=15
y=5

get_focus u
o=0

get_prop 6 q
if q=0 then set_prop 6 1

press "shoot_half"
sleep 800
click "shoot_full"

print "SET - Stop Rec"
print "Shoot Half - Auto Focus"

:loop


wait_click

if is_key "zoom_in" then goto "in"
if is_key "zoom_out" then goto "out"
if is_key "up" then goto "focus_1"
if is_key "down" then goto "focus_2"

if is_key "shoot_half" then set_aflock 1

if is_key "set" then goto "end"

if is_key "menu" then goto "menu_focus"
if is_key "display" then goto "display_focus"

goto "loop"


:in
if z<0 then z=1
if z>13 then z=13
set_zoom_rel z
get_zoom r
set_zoom_speed y
sleep 100
set_aflock 1
print "zoom ", r
print "zoom speed ", y
goto "loop"

:out
if z<0 then z=1
if z>13 then z=13
set_zoom_rel -z
get_zoom r
set_zoom_speed y
sleep 100
set_aflock 1
print "zoom ", r
goto "loop"

:focus_1
set_zoom_rel 15
set_zoom_speed y
set_aflock 1
goto "loop"
return

:focus_2
set_zoom_rel -15
set_zoom_speed y
set_aflock 1
goto "loop"
return

:menu_focus
v=v+1
gosub "focus_DISP/MENU"
goto "loop"

:display_focus
v=v-1
gosub "focus_DISP/MENU"
goto "loop"

:focus_DISP/MENU
u=(v*v*v*v)
if v>=12 then u=65535
if v<1 then let v=1
if v>20 then let v=20
set_focus u
get_focus t
print "focus", v; "/20 ("t; " mm)"
return

:end
click "shoot_full"
end

end

wait_click
cls
return

Re: SX200 Zoom / Autofocus
« Reply #1 on: 29 / November / 2009, 14:44:51 »
Why does the zoom stop when i hold the up button, can't you make it detect holding down a button?

 

Related Topics


SimplePortal © 2008-2014, SimplePortal