uBasic script reference on the wiki - Script Writing - CHDK Forum supplierdeeply

uBasic script reference on the wiki

  • 3 Replies
uBasic script reference on the wiki
« on: 25 / October / 2008, 05:33:55 »
I'm just curious .. I've started fiddling with CHDK and am trying to learn how to make scripts in uBasic.

Problem is - the wiki's resources are confusing, contradictory [especially], and incomplete. 

I've tried looking at example scripts but certain functions I'm looking to use [such as forcing a specific shutter speed and aperture] are simply not used in any of the scripts I've looked through so far.  All of them work on automating the choosing of such values rather than forcing them. 

I'm experiencing a great deal of confusion over what actual functions are valid or not - given the existence of, say, set_tv and set_tv96 and other related funtions which are incompletely described and the use of which appears to produce no results whatsoever. 

Maybe I've just been away from programming for too long, but the [English] references [at least] are insufficient for me to figure out how to do what I want.

If anyone can lend any advice on this, I'd appreciate it.


Specifically what I'm trying to do is this.. some of the steps may seem extraneous but I'm starting off by making no assumptions as to camera settings.  The purpose is to do bracketed night photography in a city setting, where the usual range from street lighting and the like is usually fairly consistent.  My camera is an A590is and I'm using the beta CHDK for firmware 1.01b [which may in fact be part of the issue].

1. force zoom to the widest setting [this works]
2. force aperture to the lowest setting [this does not work, trying to use simply set_av and other variants]
3. force focus to hyperfocal distance [this works]
4. force ISO to the camera's lowest standard setting [this appears to work]
5. take 4 exposures forcing the shutter speed to 8, 3.x, and 1 second(s) followed by a 1/250th to balance out in-frame light sources [this does not work at all, whether trying set_tv or set_tv96 or any other related things I see in the reference, all the camera ever does is shoot the already-set shutter speed - noting that I'm in manual mode]

This was my intended goal, to simply force all the settings, leaving fancy stuff until after I've learned what in my mind would be the simplest point to start.  Given the many other user scripts I've looked at so far, this assumption of mine is quite wrong, since what I would refer to as the more complicated things actually seem to work just fine.
« Last Edit: 25 / October / 2008, 06:14:52 by dexotaku »


Offline fbonomi

  • ****
  • 469
  • A570IS SD1100/Ixus80
    • Francesco Bonomi
Re: uBasic script reference on the wiki
« Reply #1 on: 25 / October / 2008, 06:18:13 »
what camera do you have?
some cameras do not have an iris, so the set_av cannot work

otherwise, try inserting some delays before and after the set_av commands, like "sleep 500" or similar

also, try using set_av96_direct or set_av96

lastly, posting your code and type of camera would help us help you :-)


Offline fudgey

  • *****
  • 1705
  • a570is
Re: uBasic script reference on the wiki
« Reply #2 on: 25 / October / 2008, 08:55:09 »
The a590 port is still very much work in progress and even though I haven't followed it closely, it's missing some operability. I think Av manipulation was still one of them at least a couple of days ago.

I think a590 should definitely have an iris, since it's a model that replaced the a570...and I think someone already verified this on the porting thread.

Scripting reference could indeed be improved. There are a couple of problems with that, though. First, It's nobody's job to do that (so, if you know how to improve it, you should do it yourself and if you are unsure about facts, you can try asking for help here).

Second, many of the commands that aren't documented properly are ones that are very hard to document properly, because they change something directly in the camera. The effect may be different on different camera models (as you know we support dozens of models and fw revisions), and no developer is able to test them all. Often the effect is different when called in different modes, and this especially differs among different models.

So, with some commands you need to do some experimenting with trial and error unless you can find an example that's been proven to work quite generally, because it's possible that nobody has actually tried that before. Whatever you find would be nice to have in the wiki, of course.

Re: uBasic script reference on the wiki
« Reply #3 on: 26 / October / 2008, 07:44:27 »
.. thanks for the replies.  I really should learn to be more patient is the end result of this. 


Related Topics

SimplePortal 2.3.6 © 2008-2014, SimplePortal