How to turn off power or retract lens - Script Writing - CHDK Forum

How to turn off power or retract lens

  • 12 Replies
  • 5186 Views
How to turn off power or retract lens
« on: 09 / December / 2008, 14:51:13 »
Advertisements
Is there a way in a script to turn off power or retract the lens?

I want to use the USB power detect method to signal the camera to turn off power.   Why?  To prevent damage on landing.  The camera will be attached to a glider under the wing.  If I can remote sense the USB power, I can signal from the ground on landing approach to retract the lens so it does not get scratched, broken, etc.

BTW, I am using an SD1100 IS camera.

Thanks!
Was: SD1100 IS, Autobuild, V1.01a, dunked in ocean
Next: SD990 IS, Autobuild, used to build sand castles with
Waiting to die: SX230

*

Offline fudgey

  • *****
  • 1705
  • a570is
Re: How to turn off power or retract lens
« Reply #1 on: 09 / December / 2008, 15:03:17 »
Script command: shut_down


Re: How to turn off power or retract lens
« Reply #2 on: 09 / December / 2008, 15:55:28 »
Excellent!  Thank you!!
Was: SD1100 IS, Autobuild, V1.01a, dunked in ocean
Next: SD990 IS, Autobuild, used to build sand castles with
Waiting to die: SX230

Re: How to turn off power or retract lens
« Reply #3 on: 20 / December / 2008, 21:53:13 »
I have just tried the "shut_down" command but it gives me the unk response.

I simplified the script to just the following active lines:
:loop
click "shut_down"
goto "loop"

It loops around and around, each time blinking the unk response on the camera screen instead of powering the camera down.

Using Dave Mitchells UBasic Debugger shows this for that line:
*** button click 'shut_down' ***


Is it possible that my SD1100IS does not know this command or has a different name for it?  Any and all help appreciated!
Thanks!

ps: in other news, I have successfully detected the USB power and used it to control the camera.

Was: SD1100 IS, Autobuild, V1.01a, dunked in ocean
Next: SD990 IS, Autobuild, used to build sand castles with
Waiting to die: SX230


*

Offline Hacki

  • ****
  • 358
  • SX100
Re: How to turn off power or retract lens
« Reply #4 on: 20 / December / 2008, 21:56:06 »
"shut_down" is not a button. Try just typing shut_down there, instead of click "shut_down".


Re: How to turn off power or retract lens
« Reply #5 on: 20 / December / 2008, 22:50:41 »
Thanks Hacki!

I found I also needed a delay for it to work.  This works fine:

rem shutdown test

@title Shutdown


:loop
shut_down
wait_click 2000
goto "loop"

end

Now back to the usb connection detection...
Thanks again!!!
Was: SD1100 IS, Autobuild, V1.01a, dunked in ocean
Next: SD990 IS, Autobuild, used to build sand castles with
Waiting to die: SX230

Re: How to turn off power or retract lens
« Reply #6 on: 20 / December / 2008, 23:03:01 »
Ok, back again.  But this time, all is working, all is good!

I have the camera script written to take photos about 2 seconds apart.  The camera will mount on my electric propulsion sailplane.  When it's time to land, I flip a switch on a spare channel on the radio control transmitter and the camera stops shooting and turns off, pulling in the lens and closing the lens cover.  Hopefully, this will help the camera live longer.

 :) :) :)

Thanks to all for help.  This is a great forum!  And of course, CHDK is OUTSTANDING!!!
Was: SD1100 IS, Autobuild, V1.01a, dunked in ocean
Next: SD990 IS, Autobuild, used to build sand castles with
Waiting to die: SX230

Re: How to turn off power or retract lens
« Reply #7 on: 22 / December / 2008, 12:05:14 »
Will your camera shoot video? That would also be awesome!!

And then you could watch your landing approach later at home! :o
~~~~~~~~~~~~~~~~~~~~~

<")%%%><<


Re: How to turn off power or retract lens
« Reply #8 on: 22 / December / 2008, 14:38:37 »
Yes, it should do video as well.  I have not experimented much with the video functions yet but certainly will.  And with the interface I built, I can do a remote start of the video and then do a power down for landing as well to pull in the lens.

This is getting to be too much fun!  I have a few days off this week for the holidays so I plan on trying some various new scripts. 

It would be really cool if there was a way to get the camera to barf out picture files for sending back on a telemetry link while flying. 

Still learning...
Was: SD1100 IS, Autobuild, V1.01a, dunked in ocean
Next: SD990 IS, Autobuild, used to build sand castles with
Waiting to die: SX230

*

Offline PhyrePhoX

  • *****
  • 2254
  • make RAW not WAR
    • PhyreWorX
Re: How to turn off power or retract lens
« Reply #9 on: 22 / December / 2008, 16:51:14 »
shut_down, why does it need the delay? i also read somewhere that sometimes it works putting shut_down twice in a script (but maybe this is just the same as an additional delay). will have to investigate about it (maybe i can add the delay in C, so you dont need to use it in script). will create a bugticket bout it.

 

Related Topics