IXUS 860 - Detect MODE_REC / MODE_PLAY - General Discussion and Assistance - CHDK Forum

IXUS 860 - Detect MODE_REC / MODE_PLAY

  • 11 Replies
  • 4130 Views
IXUS 860 - Detect MODE_REC / MODE_PLAY
« on: 12 / July / 2009, 07:52:51 »
Advertisements
Hi,

I am in MODE_PLAY of the camera to see the taken photos.
Now I want to take a photo again and I press shutter button half to make camera switch to MODE_REC.
In which function I can detect that the camera enters the MODE_REC?

I need this to set the camera to focal length 46 mm if camera goes to MODE_REC.

Thanks for any hints!
2 x IXUS 860IS 100c
2 x Powershot S110 103a

Re: IXUS 860 - Detect MODE_REC / MODE_PLAY
« Reply #1 on: 12 / July / 2009, 16:51:31 »
if ((mode_get()&MODE_MASK) == MODE_REC)

Re: IXUS 860 - Detect MODE_REC / MODE_PLAY
« Reply #2 on: 13 / July / 2009, 05:10:42 »
Hi Microfunguy,

thanks, what you provided is how one can detect if cam is in REC or PLAY mode, this I know already.
But I need a trigger WHEN the cam comes to MODE_REC, that means I need a place of code which is executed if cam enters MODE_REC, there I can place my code to put lens to focal length 46 mm.

Hope it's more clear now?

2 x IXUS 860IS 100c
2 x Powershot S110 103a

Re: IXUS 860 - Detect MODE_REC / MODE_PLAY
« Reply #3 on: 13 / July / 2009, 06:16:01 »

Hope it's more clear now?


Certainly is.

In core_spytask(), add the following :-

Code: [Select]
int pm=mode_get()&MODE_MASK; 

    while (1)
   {
     if((pm==MODE_PLAY) && ((mode_get()&MODE_MASK) == MODE_REC)) shooting_set_zoom(3);
     pm=mode_get()&MODE_MASK;


P.S.
Do not forget to reply to my question in 'Script Writing' about your fix for script autorun.

Re: IXUS 860 - Detect MODE_REC / MODE_PLAY
« Reply #4 on: 14 / July / 2009, 15:18:31 »
Hi,

thanks for your reply.
The if condition you wrote cannot work because you will never get the exact timepoint when the camera switches from MODE_PLAY to MODE_REC.
But anyway you gave me the right hint where to place the code.
I placed it as 1st statement inside the while(1) statement of function core_spytask as you mentioned.
Therefore thanks a lot, this helped.

I just changed the code like follows:

int currMode = 0; // at beginning of core_spytask
int lensIsZoomed = 0;
...

// here inside while(1)
currMode = mode_get() & MODE_MASK;
   
if (currMode == MODE_REC)
{
  if (lensIsZoomed == 0)
  {
    lensIsZoomed = 1;      
    lens_set_zoom_point(2);      
  }
}
else
  lensIsZoomed = 0;

Now I have my 3D cam almost ready.
It zoomes to 46 mm on turning on the cam and now it also switches to 46 mm
if I switch back from REC mode to PLAY mode.
Really comfortable now!

Thanks a lot!
2 x IXUS 860IS 100c
2 x Powershot S110 103a

Re: IXUS 860 - Detect MODE_REC / MODE_PLAY
« Reply #5 on: 14 / July / 2009, 15:26:42 »
The if condition you wrote cannot work


Works on my A620  :)

pm = previous mode.


Re: IXUS 860 - Detect MODE_REC / MODE_PLAY
« Reply #6 on: 14 / July / 2009, 15:32:05 »
OK, I cannot say, but on my IXUS 860 it does not work.

But thanks anyway it finally helped!
2 x IXUS 860IS 100c
2 x Powershot S110 103a

Re: IXUS 860 - Detect MODE_REC / MODE_PLAY
« Reply #7 on: 14 / July / 2009, 15:35:20 »
When this is complete, why not publish the details and also check the synch using a CRT monitor and the method described on the SDM website ?

Re: IXUS 860 - Detect MODE_REC / MODE_PLAY
« Reply #8 on: 15 / July / 2009, 02:18:03 »
Hi Microfunguy,

I don't know if it is already ready to publish. I should add an entry in the conf to enter the zoom step.
I also do not know where and how to publish.

What do you mean saying:

> check the synch using a CRT monitor and the method described on the SDM website ?
2 x IXUS 860IS 100c
2 x Powershot S110 103a

Re: IXUS 860 - Detect MODE_REC / MODE_PLAY
« Reply #9 on: 15 / July / 2009, 05:04:38 »
I should add an entry in the conf to enter the zoom step.

You could use 'conf.digi_zoom_setting'.
It is normally used for Digiscoping and is set in menu Advanced\Digiscoping.

Quote
I also do not know where and how to publish.
Just do a post here with photos in section 'Creative uses of CHDK'.

Quote
What do you mean saying:
> check the synch using a CRT monitor and the method described on the SDM website ?


See details here.

Typical synch is 1/5000 sec !
The results of many synch tests are presented as spreadsheets in the Files section of Yahoo SDM Group.


 

Related Topics


SimplePortal © 2008-2014, SimplePortal