LED control - page 2 - General Discussion and Assistance - CHDK Forum

LED control

  • 32 Replies
  • 8773 Views
*

Offline Jucifer

  • *****
  • 251
  • [A710IS]
Re: LED control
« Reply #10 on: 08 / April / 2008, 08:57:41 »
Advertisements
Really nice find.

I don't think the numbering/syntax really matters, as long as it is documented.

Re: LED control
« Reply #11 on: 08 / April / 2008, 17:07:43 »
Nice function! Actually there is no yellow led (on the s3 at least). There is a red and green led and both on gives - yellow :) (if they are mounted close together)! That's an old sneaky way of getting three color led function from only two led's. Normally green is on and then using no 5 make it yellow. For some models in the trunk no 6 give yellow, no 5 give red. Undocumented feature :-[
 I think the numbering comes from from UniqueLed function originally.
« Last Edit: 08 / April / 2008, 17:16:27 by fingalo »

*

Offline ewavr

  • ****
  • 1057
  • A710IS
Re: LED control
« Reply #12 on: 08 / April / 2008, 18:16:57 »
Now this function added to A710 (to make AF LED control from script). LED numbers are compatible with old scripts.

@ a710is:
now try:

Code: (freebasic) [Select]
rem AF LED on
set_led 10 1
sleep 2000
rem AF LED off
set_led 10 0
sleep 2000
rem AF LED blink (second parameter>1)
set_led 10 3
end

*

Offline a710is

  • ****
  • 250
  • A710 IS
Re: LED control
« Reply #13 on: 09 / April / 2008, 05:19:06 »
thanks ewavr, with the new build the AF led can be controlled :)

so here's a script that can be started during zoom video recording that allows to film even in complete darkness using the AF lamp continuously plus manual focus in alt mode :D

Code: [Select]
rem script by kamil modified by a710is
@title focus in video
@param a auto focus /erase/
@default a 11
@param b auto focus /left/
@default b 3
@param d auto focus /set/
@default d 5
@param e auto focus /right/
@default e 7
@param f auto focus /up/
@default f 9
@param g auto focus /down/
@default g 1


@param j help (1-on)

if j=1 then gosub "help"

get_prop 12 q
if q=0 then set_prop 12 1

get_focus u
o=0

do
o=o+1
p=o*o*(o+1)*(o+1)+90
until u<p

v=o

set_led 10 1
press "shoot_half"
sleep 800
print "HALF SHOOT - stop record"
:loop
wait_click
if is_key "up" then goto "focus_5"
if is_key "down" then goto "focus_6"
if is_key "left" then goto "focus_2"
if is_key "set" then goto "focus_3"
if is_key "right" then goto "focus_4"
if is_key "erase" then goto "focus_1"
if is_key "shoot_half" then goto "end"
if is_key "menu" then goto "add_focus"
if is_key "display" then goto "min_focus"


goto "loop"


:focus_1
v=a
gosub "focus_dance"
goto "loop"

:focus_2
v=b
gosub "focus_dance"
goto "loop"

:focus_3
v=d
gosub "focus_dance"
goto "loop"

:focus_4
v=e
gosub "focus_dance"
goto "loop"

:focus_5
v=f
gosub "focus_dance"
goto "loop"

:focus_6
v=g
gosub "focus_dance"
goto "loop"

:add_focus
v=v+1
gosub "focus_dance"
goto "loop"

:min_focus
v=v-1
gosub "focus_dance"
goto "loop"

:focus_dance
u=(v*v*v*v)+90
if v>=11 then u=65535
if v<1 then let v=1
if v>11 then let v=11
set_focus u
get_focus t
print "focus", v; "/11 ("t; " mm)"
return

:end
click "shoot_full"
set_led 10 0
sleep 2000

end

end

:help
print "Use with CAUTION"
print "working on A710 IS"
print "maybe others too"
print "or you need modify this"
print " - [ click ANY KEY ] - "
wait_click
print "this script allows"
print "to configure buttons"
print "to toggle between"
print "11 focus steps"
print " - [ click ANY KEY ] - "
wait_click
print "keys: UP/DOWN/"
print "/LEFT/SET/RIGH and"
print "ERASE are configurable"
print "focus positions"
print " - [ click ANY KEY ] - "
wait_click
print "DISPLAY and MENU"
print "increase/ decrease focus"
print "You can disable focus"
print "assignment by entering"
print " - [ click ANY KEY ] - "
wait_click
print "0 parameter"
print "to stop recording"
print "Press SHOOT HALF"
print "Enjoy"
print " - [ click ANY KEY ] - "

wait_click
cls
return


« Last Edit: 09 / April / 2008, 05:33:41 by a710is »


*

Offline PhyrePhoX

  • *****
  • 2254
  • make RAW not WAR
    • PhyreWorX
Re: LED control
« Reply #14 on: 09 / April / 2008, 05:30:08 »
any experience regarding af-lamp and life-cycle? it's a pretty strong for a LED, is it really an LED? will it turn hot (well, not if its an LED)?

*

Offline a710is

  • ****
  • 250
  • A710 IS
Re: LED control
« Reply #15 on: 09 / April / 2008, 05:37:58 »
it's a led, it doesn't turn hot and I'd expect it has a pretty long life span. I'm not gonna use this so often anyway and if it breaks down I believe I can do without it; I doubt there's anything to worry about anyway.
I'm gonna try to search for a tiny magnifier for it to maybe stick it on the cam and difuse its light. :)

*

Offline a710is

  • ****
  • 250
  • A710 IS
Re: LED control
« Reply #16 on: 09 / April / 2008, 06:01:21 »
update on the Manual focus and presets in video mode script: I've reconfigured the disp and menu buttons, instead of add focus/ reduce focus, now they stand for AF lamp ON / AF lamp OFF. so the lamp can now be turned on and off at will during video recording :) at the press of one or the other button.

edit: whoops wrong script :D there I fixed it

Code: [Select]
rem script by kamil modified by a710is
@title focus and AF lamp in video
@param a auto focus /erase/
@default a 11
@param b auto focus /left/
@default b 3
@param d auto focus /set/
@default d 5
@param e auto focus /right/
@default e 7
@param f auto focus /up/
@default f 9
@param g auto focus /down/
@default g 1


@param j help (1-on)

if j=1 then gosub "help"

get_prop 12 q
if q=0 then set_prop 12 1

get_focus u
o=0

do
o=o+1
p=o*o*(o+1)*(o+1)+90
until u<p

v=o


press "shoot_half"
sleep 800
click "shoot_full"
print "HALF SHOOT - stop record"
:loop
wait_click
if is_key "up" then goto "focus_5"
if is_key "down" then goto "focus_6"
if is_key "left" then goto "focus_2"
if is_key "set" then goto "focus_3"
if is_key "right" then goto "focus_4"
if is_key "erase" then goto "focus_1"
if is_key "shoot_half" then goto "end"
if is_key "menu" then goto "af_led_on"
if is_key "display" then goto "af_led_off"


goto "loop"


:focus_1
v=a
gosub "focus_dance"
goto "loop"

:focus_2
v=b
gosub "focus_dance"
goto "loop"

:focus_3
v=d
gosub "focus_dance"
goto "loop"

:focus_4
v=e
gosub "focus_dance"
goto "loop"

:focus_5
v=f
gosub "focus_dance"
goto "loop"

:focus_6
v=g
gosub "focus_dance"
goto "loop"

:af_led_on
set_led 10 1
goto "loop"

:af_led_off
set_led 10 0
goto "loop"

:focus_dance
u=(v*v*v*v)+90
if v>=11 then u=65535
if v<1 then let v=1
if v>11 then let v=11
set_focus u
get_focus t
print "focus", v; "/11 ("t; " mm)"
return

:end
click "shoot_full"
set_led 10 0
sleep 2000

end

end

:help
print "Use with CAUTION"
print "working on A710 IS"
print "maybe others too"
print "or you need modify this"
print " - [ click ANY KEY ] - "
wait_click
print "this script allows"
print "to configure buttons"
print "to toggle between"
print "11 focus steps"
print " - [ click ANY KEY ] - "
wait_click
print "keys: UP/DOWN/"
print "/LEFT/SET/RIGH and"
print "ERASE are configurable"
print "focus positions"
print " - [ click ANY KEY ] - "
wait_click
print "DISPLAY and MENU"
print "turn AF led OFF and ON"
print "You can disable focus"
print "assignment by entering"
print " - [ click ANY KEY ] - "
wait_click
print "0 parameter"
print "to stop recording"
print "Press SHOOT HALF"
print "Enjoy"
print " - [ click ANY KEY ] - "

wait_click
« Last Edit: 09 / April / 2008, 06:18:44 by a710is »

*

Offline a710is

  • ****
  • 250
  • A710 IS
Re: LED control
« Reply #17 on: 09 / April / 2008, 06:36:45 »
I'm thinking about a version of the script where the erase button would toggle the AF off and on but I don't know how to assign a loop of functions to a single button. how do I do that?


Re: LED control
« Reply #18 on: 09 / April / 2008, 10:23:28 »
Deleted
« Last Edit: 22 / April / 2008, 16:45:50 by Barney Fife »
[acseven/admin commented out: please refrain from more direct offensive language to any user. FW complaints to me] I felt it imperative to withdraw my TOTAL participation. Nobody has my permission, nor the right, to reinstate MY posts. Make-do with my quoted text in others' replies only. Bye

*

Offline PhyrePhoX

  • *****
  • 2254
  • make RAW not WAR
    • PhyreWorX
Re: LED control
« Reply #19 on: 09 / April / 2008, 10:51:11 »
hm, maybe only the part that starts containing scripts. the led thingy itself can remain in dev forum, can't it?

 

Related Topics