basic scripting question - Script Writing - CHDK Forum

basic scripting question

  • 3 Replies
  • 1788 Views
*

Offline tgran

  • *
  • 12
  • A570IS (101A)
basic scripting question
« on: 10 / April / 2009, 07:05:20 »
Advertisements
I'm setting up an arduino triggered USB remote for my canon a570is.  I'd like to have the basic shutter response happen as soon as possible after the shortest USB signal pulse.  However, I also need periodic metering and focusing. 

How do I script a periodic "half_shoot" between the "do/until --> if/then --> camera action" loops?  Depending how I have it set up I expect the trigger to occur every 3 to 1000 seconds and I'd like to have the focusing/metering occur approximately every 5 seconds.  I might also use manual focus (infinity) with periodic exposure metering for some applications.  All of this will mainly be for bright light. 

All advice welcome and thanks for a great forum!
« Last Edit: 12 / April / 2009, 15:50:41 by tgran »

Re: basic scripting question
« Reply #1 on: 10 / April / 2009, 18:13:14 »
does the shoot() function meter and focus? i recently found reliability problems with press half_shoot, press full_shoot

*

Offline fbonomi

  • ****
  • 469
  • A570IS SD1100/Ixus80
    • Francesco Bonomi
Re: basic scripting question
« Reply #2 on: 11 / April / 2009, 04:39:49 »
What do you mean by "as soon as possible" ?
How critical is time? half a second? a second?

If time is really critical, then you'll have to delve in the arcane techniques used in motion detect.

why do you need metering/focusing every 5 seconds?

is this to be ready to shoot when requested by the USB?

I don't know if you want tu use uBasic or LUA, but in pseudo-code I wouldo something like:

count=0
loop

 loop
   wait 0.1 seconds
   count=count+1
   if count=50 then
     meter & focus
     count=0
   endif
 until the usb says to shoot
 take the shot

until 1=2


*

Offline tgran

  • *
  • 12
  • A570IS (101A)
Re: basic scripting question
« Reply #3 on: 11 / April / 2009, 23:44:10 »
The arduino controller has multiple functions depending on what sensors I plug into it and how I program it but I guess you could think of it as an external motion detect system that can trigger multiple cameras simultaneously.  It would be great to get similar reaction times to the MD scripts. 

I think my main question is whether running a counter outside the loop (to allow periodic metering) slows down reaction speed.  I guess I could send two different pulse lengths from the arduino controller (one for half press, followed by one for shooting when the sensors detects) but then I would need an extra line of code -->    if a<2 press "full shoot", if a>2 press "half_shoot".  Or I could maintain voltage on the USB following metering and use the voltage drop as the trigger. 

 I guess I need to dig into different motion detect scripts.  I'm not sure how to do any of this in practice. 

Edit:  It looks like the stuff I want already exists in SDM as the default (without a script!).  The delay is very short.  Great! 
« Last Edit: 12 / April / 2009, 15:51:39 by tgran »


 

Related Topics