LED on until camera has finished?? - Script Writing - CHDK Forum  

LED on until camera has finished??

  • 3 Replies
  • 2340 Views
LED on until camera has finished??
« on: 06 / October / 2008, 11:09:33 »
Advertisements
Hi, I'm making some progress with my PanoHead, I already can sent different commands to my S3 cam, but now I need some feedback from the camera. On my Fuji S5600 i had a status LED which indicated when the cam has finished taking a picture, so I mounted a phototransistor on it. Now I'm trying to implement the same feature in my uBasic script, but without real success.
Code: [Select]
do
a=get_usb_power
until a>0

if a<14 and b=0 then
set_led 10 1
print "take photo"
click "shoot_full"
sleep 100
do
 get_prop 205 w
until w<>1
set_led 10 0
endif
b is always zero at the moment, it's meant for bracketed shots in the future.
I tried
Code: [Select]
click "shoot_full"and
Code: [Select]
shoot,
sometimes the LED is on quite a while, sometimes it's off while shooting, and sometimes it blinks after shooting for a second or so.... the LED is the one on the front, next to the flash light.
Anybody an idea for me??

Thanks alot!

Volker

*

Offline fudgey

  • *****
  • 1705
  • a570is
Re: LED on until camera has finished??
« Reply #1 on: 06 / October / 2008, 12:57:24 »
It may not be possible to prevent Canon's firmware from turning LEDs on and off whenever it wishes to do so. Some LEDs can be controlled from scripts, but CHDK doesn't take over control of the LEDs completely.

I guess you're having the script do something that makes the camera set the status of the LED that you are using. Like shooting... You need to take a look at your user's manual to see what those LEDs do. The blue LED in A series normally only(?) shines while writing an image to the card, if the S3 has a similar LED you should probably use it instead.

And if you can't find a LED "free" enough, a way out of this is to output a simple blink sequence for communication and software in the receiver end to decode/detect it.



Re: LED on until camera has finished??
« Reply #2 on: 16 / October / 2008, 11:02:04 »
Hi! I tried to change my method, doing a 10 ms blink at the beginning and a 20 ms at the end, but I have still the problem that I got my end-blink too early, looks like I got it after automatic focusing etc., so it blinks "end" and then takes the shot....
Code: [Select]
a=get_usb_power
until a>0

if a<14 and b=0 then
gosub "led_start"
print "take photo"
press "shoot_half"
do
get_prop 205 z
until z=1
press "shoot_full"
do
get_prop 205 z
until z=1
release "shoot_full"
gosub "led_stop"
endif

:led_start
set_led 10 1
sleep 10
set_led 10 0
return

:led_stop
set_led 10 1
sleep 20
set_led 10 0
return

end


*

Offline fudgey

  • *****
  • 1705
  • a570is
Re: LED on until camera has finished??
« Reply #3 on: 16 / October / 2008, 17:49:32 »
If you are using a led that Canon uses to signal that auto focus has succeeded/failed/whatever, then it will certainly blink that way and there's not much you can do about it...but that's not the problem here.

But this would make more sense to me:

Code: [Select]
gosub "led_start"
print "take photo"
press "shoot_half"
rem wait for focus and auto exposure before we shoot
do
get_prop 205 z
until z=1
press "shoot_full"
release "shoot_full"
release "shoot_half"
rem wait for shooting to actually finish
do
get_prop 205 z
until z<>1
gosub "led_stop"
endif

Oh and I think your blinks are not 10 ms and 20 ms, they are 20 ms and 30 ms. uBASIC takes 10 ms per line to execute (with the exception of consecutive rem lines on recent releases, only taking 10 ms per block).

Also, if you're using a recent release you should be using the universal wrapper command "z=get_shooting" instead of "get_prop 205 z" to make it more generic among camera models.

Your script may also have problems with flash and with Ae lock, related to that get_prop 205/206.


 

Related Topics