Start in macro mode? - General Discussion and Assistance - CHDK Forum

Start in macro mode?

  • 6 Replies
  • 4461 Views
Start in macro mode?
« on: 12 / March / 2013, 09:32:48 »
Advertisements
Hi all,

I have a S90 that I use mostly for record-keeping macro photography in my workshop. Taking pictures of things being disassembled etc.

The annoying thing is that I have to switch to macro mode at every boot.. Is there a way that I can get my CHDK to start the camera in macro mode rather than 'normal' mode? Can I script that, or do I then have to call that script (which would be more work than switching focus mode)?

A dirty hack in the code would be fine for me, if someone can tell me roughly where to put which call :)

Cheers!

     Rob

Re: Start in macro mode?
« Reply #1 on: 12 / March / 2013, 10:02:04 »
You can create a script that will simulate button presses to do pretty much anything you want.  And with CHDK,  you can set that script up to run automatically each time the camera starts and then exit.  You could even have the camera switch into shooting mode automatically on startup.
« Last Edit: 12 / March / 2013, 10:04:12 by waterwingz »
Ported :   A1200    SD940   G10    Powershot N    G16

Re: Start in macro mode?
« Reply #2 on: 13 / March / 2013, 08:07:15 »
Cool, thanks! I can't figure out how to run a script on startup though..  Any pointers?

Also, doesn't the camera switch to shooting mode automatically when I press 'on'?

*

Offline nafraf

  • *****
  • 1308
Re: Start in macro mode?
« Reply #3 on: 13 / March / 2013, 09:04:57 »
Cool, thanks! I can't figure out how to run a script on startup though..  Any pointers?
http://chdk.wikia.com/wiki/CHDK_User_Manual#Scripting_Parameters
Script Autostart [Off, On, Once]

Re: Start in macro mode?
« Reply #4 on: 13 / March / 2013, 10:09:35 »
Also, doesn't the camera switch to shooting mode automatically when I press 'on'?
By this statement, I'm assuming you haven't actually tried to run CHDK yet?  When CHDK loads, it essentially starts the camera in playback mode  (technically it restarts the camera).  This is because CHDK does not know as it loads whether the camera was powered on with the On/OFf butt or the Playback button.   If it was the playback button and CHDK were to start in shooting mode (extending the lens unexpectedly) this could be a problem.   So CHDK always starts the camera in playback mode.    You can get around this by holding the On/Off button down during startup until the lens starts to extend.
Ported :   A1200    SD940   G10    Powershot N    G16

Re: Start in macro mode?
« Reply #5 on: 13 / March / 2013, 23:53:06 »
By this statement, I'm assuming you haven't actually tried to run CHDK yet? 

I have.. :)  Running some random dev version compiled half a year back or so.

When CHDK loads, it essentially starts the camera in playback mode  (technically it restarts the camera).  This is because CHDK does not know as it loads whether the camera was powered on with the On/OFf butt or the Playback button.   If it was the playback button and CHDK were to start in shooting mode (extending the lens unexpectedly) this could be a problem.   So CHDK always starts the camera in playback mode.    You can get around this by holding the On/Off button down during startup until the lens starts to extend.

I didn't know that, thanks for the explanation. I've used chdk for so long that I don't even remember how the bare camera used to behave w.r.t. the power-on button.

Anyway, the following mini script does what I want:

Code: [Select]
@title Set macro mode.

click "left"
sleep 500

click "left"
sleep 500

exit_alt 0
end

If I don't set 'script shoot delay' to half a second or so, the camera freezes on boot. The exit_alt and autostart took a while to figure out, heh. A refinement would be to only press 'left' twice when in shooting mode, not in playback.



Re: Start in macro mode?
« Reply #6 on: 14 / March / 2013, 00:06:23 »
I have.. :)  Running some random dev version compiled half a year back or so.
Things change fast around here - including important bug fixes.  You might want to update what you are using?

Quote
A refinement would be to only press 'left' twice when in shooting mode, not in playback.
Put this bit of code into your script at the start so that the script always forces you into shooting mode ...

Code: [Select]
sleep 1000
if get_mode = 0 then goto "in_rec"
  sleep 500
  set_record 1
:wait_rec
  sleep 100
  if get_mode <> 0 then goto "wait_rec"
:in_rec
Ported :   A1200    SD940   G10    Powershot N    G16

 

Related Topics


SimplePortal © 2008-2014, SimplePortal