60 second shutdown script? - page 2 - Script Writing - CHDK Forum  

60 second shutdown script?

  • 13 Replies
  • 11889 Views
*

Offline zeno

  • *****
  • 891
Re: 60 second shutdown script?
« Reply #10 on: 07 / July / 2008, 04:07:41 »
Advertisements
You can use the shut-down command to switch the camera off. You'll just need a bit of logic in the loop that's waiting for power to be applied - count seconds in there and if the counter gets to 60 then shut down.

Something like this ought to work:

Code: [Select]
@title remote shutter script with auto-shutdown
@param t shutdown delay in seconds (0 = never)
@default t 60
if t = 0 then t = 64000
while 1
   i = get_day_seconds
   do
      j = get_day_seconds - i
      if j > t then shut_down
      a = get_usb_power
   until a>0
   shoot
wend
end
« Last Edit: 07 / July / 2008, 05:28:50 by zeno »
A570, S100, Ixus 127
Author of ASSIST, STICK, WASP, ACID, SDMInst, LICKS, WICKS, MacBoot, UBDB, CFGEdit

Re: 60 second shutdown script?
« Reply #11 on: 07 / July / 2008, 13:32:49 »
Zeno,

Thankyou for your reply. I tryed your script and must say: It works far better then anything I have tryed- thanks again!
With your script: when I let the timer go beyond the set amount and then trip the shutter the camera takes one last
picture and then shuts down. Meaning it does not shut down atomatically at time out. Maybe that is not possible ??
It also seems to work more consistently when I load the script manually. I have since found out that you cannot let the LCD
time out before the shutdown time.
I just thought you might like to know how it is working for me. It is great to have the added control and I'm going to go with it.

My experiments also involved the use of get_usb_power since I can wire the gentLED usb cable to send a long signal by
leaving the switch on for a bit longer. Basically, I thought short signal- take photo. Long signal shut down. But the script would start and end with nothing. As I am new at this- I find these scripts are quite a puzzle.
This was my last try:
while 1
   do
      a = get_usb_power
   until a>0
 if a<50 then shoot
 else if a>300 then shut_down
wend

Any suggestions with this method?
« Last Edit: 08 / July / 2008, 00:39:20 by Propfly »

*

Offline zeno

  • *****
  • 891
Re: 60 second shutdown script?
« Reply #12 on: 08 / July / 2008, 16:29:09 »
jim
i'm away on holiday with limited internet access. back next week.
note that getusbpower units are 10milliseconds, so 300=3 seconds.
A570, S100, Ixus 127
Author of ASSIST, STICK, WASP, ACID, SDMInst, LICKS, WICKS, MacBoot, UBDB, CFGEdit

Re: 60 second shutdown script?
« Reply #13 on: 15 / August / 2008, 20:02:20 »
Is it possible to use :loop ... goto "loop"  with  get_usb_power ?I think something like this:
@title shutdown
t=60
goto "start"
:start
   i=get_day_seconds
   goto "loop"
:loop
   j=get_day_seconds-i
   if j>t then goto "shutdown"
   a=get_usb_power
   if a<1 then goto "loop"
   shoot
   goto "start"
:shutdown
   shut_down
   sleep 1500
   end   

Last edit: as the 'shut_down'maybe needs some 'sleep',I have it get out of the loop.Sorry I haven't usb remote to test this
scipt completely but running it the delay of 1min has been respected and the shutdown works perfectly.
« Last Edit: 23 / August / 2008, 17:54:44 by maka45 »


 

Related Topics


SimplePortal 2.3.6 © 2008-2014, SimplePortal