Autostart Continuous mode - Script Writing - CHDK Forum

Autostart Continuous mode

  • 9 Replies
  • 3924 Views
Autostart Continuous mode
« on: 05 / June / 2012, 13:50:11 »
Advertisements
I've been trying to help KenO make his camera go into Continuous Shooting mode at power-up, but his camera is a different model than mine, so I'm handicapped on this one.

On my S3 IS, an amazingly short script did the trick:

@title Auto Continuous
click "timer"
exit_alt
end

I loaded that in my S3, set it to Autostart, powered it off & on, and Bingo! i was in Continuous Shooting mode.

But KenO has an A570, which doesn't have my S3's separate Timer button.

I looked up the A570 on www.Steves-Digicams.com, whose reviews and tests are so thorough that I can use them to navigate the menus (I thought).  He accesses Continuous Mode via the Function button, which uBASIC calls "erase" after its use in Playback.  Here's what I told him to try:

rem AutoCont.bas starts the A570 up in Continuous mode
@title Auto Continuous
rem activate Function key
click "erase"
rem navigate to Continuous Mode
click "down"
click "down"
click "right"
rem exit Function menu
click "erase"
exit_alt
end

He tried it today and saw this at power-on:  "uBASIC:12 Parse error"

I'll be the first to admit that I'm a newbie at this, and without a test platform, I'm a blind newbie!  Can somebody tell us what I did wrong?

Thanks,
Eric
S3 IS with LensMate filter/hood adapter

*

Offline zeno

  • *****
  • 891
Re: Autostart Continuous mode
« Reply #1 on: 05 / June / 2012, 18:35:10 »
That message says there's something wrong with the last statement - the "end". Perhaps it needs a line feed or carriage return?
A570, S100, Ixus 127
Author of ASSIST, STICK, WASP, ACID, SDMInst, LICKS, WICKS, MacBoot, UBDB, CFGEdit

Re: Autostart Continuous mode
« Reply #2 on: 06 / June / 2012, 06:39:54 »
You could try having a look at this post: http://chdk.setepontos.com/index.php?topic=5649.0. It seems exit_alt 0 might work if exit_alt doesn't work alone.

*

Offline zeno

  • *****
  • 891
Re: Autostart Continuous mode
« Reply #3 on: 06 / June / 2012, 07:20:16 »
dbldash is right. I just ran the script with my debugger (see http://www.zenoshrdlu.com/kapstuff/zubdb.html) and adding the zero to 'exit_alt' does indeed fix the problem.
A570, S100, Ixus 127
Author of ASSIST, STICK, WASP, ACID, SDMInst, LICKS, WICKS, MacBoot, UBDB, CFGEdit


Re: Autostart Continuous mode
« Reply #4 on: 06 / June / 2012, 23:05:51 »
You could try having a look at this post: http://chdk.setepontos.com/index.php?topic=5649.0. It seems exit_alt 0 might work if exit_alt doesn't work alone.
In   trunk/lib/ubasic/ubasic.c,  line 2257  there is this :

Code: [Select]
  case TOKENIZER_EXIT_ALT:
      one_int_param_function(token, exit_alt);
      break ;

Which confirms that the ubasic tokenizer is looking for a parameter for the exit_alt function. 

This is somewhat strange as the function it calls  ( exit_alt ) is defined as  void exit_alt()  in core/kbd.c  (i.e. it is not expecting a parameter.)

Update :   looks like it was changed in rev 1221 during code cleanup by philmoz.  However, the older code and the current code both expect a parameter to the exit_alt call.


« Last Edit: 06 / June / 2012, 23:21:22 by waterwingz »
Ported :   A1200    SD940   G10    Powershot N    G16

Re: Autostart Continuous mode
« Reply #5 on: 07 / June / 2012, 07:27:55 »
So that would be extremely easy to change (just one line of code!) I wonder if when it was written a use for the token was anticipated, and just never implemented? At present it is just one more thing to remember and can potentially add confusion.

Re: Autostart Continuous mode
« Reply #6 on: 07 / June / 2012, 10:53:14 »
So that would be extremely easy to change (just one line of code!)
Yes.  And I believe it can be done so the parameter is ignored in scripts that already have the parameter in the code.

Quote
I wonder if when it was written a use for the token was anticipated, and just never implemented?
Probably.   

For now,  I changed all references to the function in the wiki to point out the need for the unneeded parameter.
Ported :   A1200    SD940   G10    Powershot N    G16

*

Offline KenO

  • ***
  • 122
Re: Autostart Continuous mode
« Reply #7 on: 07 / June / 2012, 11:19:45 »
Hi Everyone,

If everyone agrees what needs to be corrected, would someone please post the entire code and I will try it.

Thanks,

Ken


*

Offline zeno

  • *****
  • 891
Re: Autostart Continuous mode
« Reply #8 on: 07 / June / 2012, 11:25:27 »
Ken - here's the revised script:
Code: [Select]
rem AutoCont.bas starts the A570 up in Continuous mode
@title Auto Continuous
rem activate Function key
click "erase"
rem navigate to Continuous Mode
click "down"
click "down"
click "right"
rem exit Function menu
click "erase"
exit_alt 0
end
A570, S100, Ixus 127
Author of ASSIST, STICK, WASP, ACID, SDMInst, LICKS, WICKS, MacBoot, UBDB, CFGEdit

*

Offline KenO

  • ***
  • 122
Re: Autostart Continuous mode
« Reply #9 on: 12 / June / 2012, 10:32:32 »
Fri tried to post on Forum but got Error Message.

Zeno Thanks for the revised script.  Everything seems to work because when restarted got
Autostart
Finished
Auto Continuous <ALT>

Since then was able to test the code. 

1st tried to take a series of +/- bracketed photos but nothing happened.  Since I had this problem when started using the CHDK bracketed option so checked the drive mode and it was still on the default single photo setting so changed to continuous and everything worked.

Did I forget to do something?  Or is this a problem unique to the A570IS?

Hope some others will have some interest in this script and test it with other models.  Also hope someone with a A570IS will try it and see if get same results.

Thanks everyone for your help!


 

Related Topics