This is an updated version of Utilities #2. The Battery testing script has been updated to include logging the last shot and recording the battery voltages. The 3CntDwn mini-script was replaced with 3BasInt. The 3CntDwn mini-script had been improved and included in the Utilities #3, thus I was waiting to replace with another short mini-script when it became available. The 3BasInt is a very basic intervalometer mini-script.
1ReDo:2Batt :3BasInt: ( 1)
Reset:#Shots:#Shots : ( 0)
Zoom :FilNum: IM : ( 0)
Focus: : IS : ( 0)
. : : SH : ( 0)
. : : SM : ( 0)
. : : : ( 0)
Like the last time , each mini-script is identified by the first parameter line and the mini-script is chosen by the number in the name of the min-script. If there are parameters for that mini-script, they are shown in the column just below the mini-script name.
Utility mini-scripts
1ReDo. Due to the limited number of characters allowed in a single posting, please see previous Utilities #2 posting for the function of this mini-script.
2Batt. This mini-script was written to help a CHDK user test the maximum number of shots that could be taken by a set of batteries. It was designed to zoom all the way in, take a shot, zoom all the way out, take a shot and then continuously repeat until the batteries could no longer take photos. The mini-script first checks the maximum number of zoom steps that are available for the camera, and then uses that limit for the zooming out step. While some safegaurds have been built in, the user is cautioned to use at your own risk.
Update to original script:
The script has been updated to allow using smaller SD Cards since the camera may be able to take more photos than an SD Card can hold until the battery voltage runs down. Since the process for erasing photos on a camera is unique to that camera model it isn't easy to code into a UBasic script, so I added:
- "#Shots" parameter to allow you to shoot a set amount of shots and then stop the script to allow you to delete the images on the SD Card and then restart the script. The counter will restart at 1 for each run, so you'll just have to keep track of the shots you take each time. The final shot will be recorded on the SD Card. If you use a large enough SD Card that will hold all of the shots, then just set the "#Shots" parameter to 0 and it will shoot until the batteries voltage runs down.
- "FilNum" parameter to allow you to change the LOG file number for each run just in case you wanted to save each run separately. This will also allow you to compare the battery voltage changes later (see following comments regarding the battery voltages). This parameter can be set to numbers greater than zero; if this value is set to zero or less, the script will set the parameter to 1.
Note: There is a special circumstance where the power may not be sufficient to complete the writing of the LOG file to the SD card and the old file will be erased and no file will be written to the SD Card. Therefore, I added a safe guard to work around this problem by using a "toggle-switch" of sorts that will write the first file using the FilNum value set in the parameter and then the next write will use the FilNum+1000 (i.e. if FilNum is set to 2, the first write will be to LOG_0002.TXT, and the next will be LOG_1002.TXT, the third LOG_0002.TXT, etc.). If the last write is unsuccessful, at least you will still have the next to last recorded file.
A provision needed to be added to record the last photo shot, so I added the ability to record:
- date & time
- last shot taken
- battery voltage when the script was started (in millivolts)
- battery voltage just after shot is taken (in millivolts)
The battery voltage is recorded to show how low the battery voltage drops before the camera shutdowns on its own. The information for the last shot taken is in the file "LOG_0001.TXT" located in the CHDK/LOGS folder on your SD Card. Each new shot rewrites the "LOG_0001.TXT" file so that only the last shot info will be saved. If you change the FilNum parameter, then each LOG file name will also change (i.e. if you change FilNum to 3, then the LOG file name will be saved as "LOG_0003.TXT"). Here is what a sample of the "LOG_0001.TXT" file looks like:
Date: 28/2/2011
Time: 14:44:0
Shot number: 5
Batt start: 5161 mv
Batt now: 5151 mv
3BasInt. While many intervalometer scripts are designed to be feature "rich" in order to allow a user to precisely control the shoot sequence, feature "rich" scripts tend to make them more complicated to use, even for script designers. There are times when only the basics are needed. Such was the case when one of the CHDK members only needed a simple intervalometer script. In response, I created this stripped down version of the feature "rich" Selective Intervalometer I wrote earlier.
The parameters: #Shots, IM (interval minutes), IS (interval seconds), SH (start hour - 24 hr clock), and SM (start minute).
- #Shots. Originally, the CHDK member wanted the ability to start the script and "let it run" until the SD card space filled up or the battery died. If the #Shots is set to zero or less, the mini-script will do just that - take photos until the space runs out or the batteries give out. If a user would just like to shoot a limited number of photos, then they can set the #Shots to a set number.
- IM & IS allow the user to very accurately set an interval time between shots. This mini-script uses
tick_count statements instead of
sleep statements to control the time between shots.
- The SH & SM allow a user to set the time for the mini-script to start (24 clock time).
Special notes:
1. Since the CHDK UBasic is an interpreted script reader, any mini-script that is time sensitive should be located near the top of the "Utility" script in order to insure the fastest run times.
2. If PropCas statements are used in a mini-script, they are specifically identified in the script positioned between "rem" statements so that they can be easily found and updated to the user's model of camera. Since the list of PropCas for the SX20 is not complete, I have been keeping track and updating the list of PropCas values that I find in the SX20 forum in this post:
http://chdk.setepontos.com/index.php?topic=4348.msg60704#msg60704Just save this script to your CHDK/SCRIPT folder as BAS
<Part 1 of 3>