supplierdeeply

Selective Intervalometer (days, days of week, hours/min, intervals min/sec)

  • 88 Replies
  • 15249 Views
*

Offline SkyWalker9

  • ****
  • 301
  • SX20 IS (fw 1.02b)
  • Publish
    Advertisements
    Author SkyWalker9
    Selective Intervalometer

    This Intervalometer is called "Selective Intervalometer". The script was designed for high accuracy and flexibility to shoot only on the days of the week (DOW) selected. The ability to individually select only the DOW you need can save substantial amounts of SD card space (and deleting unwanted photos later). A user is still be able to select a "range of days" (similar to a "range" intervalometer script) by selecting all of the days in the "range". After thinking about the amount of space needed for photos and the need to avoid shooting on some days, I thought this would be something that would be useful to a lot of people. For example, lets say you only wanted to shoot photos on Monday, Wednesday & Friday. Using this script versus a "range" script  you would  not have a series of photos from Tuesday & Thursday that wasted space on your SD card  and you would realize a 40% savings in space requirements.

    Parameters
    - Number of Shots
    - Interval (mins)
    - Interval (secs)
    - Starting Hour (24 Hour time)
    - Starting Minute
    - Ending Hour (24 Hour time)
    - Ending Minute

    The script uses "tick_count" statements in order to keep the interval times very accurate.

    There is one error check that can terminate the script early - if the Start Time is after End Time.

    The Days of the Week (DOW) to shoot photos are entered in real time by the user after starting the script. For each day of the week, the user will be presented with "DOW" input messages looking like the following:

          Left=No  Right=Yes
          Set when done
          Sun: No

    Simply use the "Right" or "Left" buttons to select yes or no, respectively, and when you are done simply press the "Set" button to proceed to the next day of the week

    Since this script normally requires a tripod or hard surface, a Caution message will be displayed if the Image Stabilization (IS) is enabled. The IS mechanism operates by correcting shake. When there is no shake, or when the level of shake is below the threshold of the system's detection capability, use of the IS feature may actually add unwanted blur to the photograph, therefore you should shut it off in this situation.

    The script waits 2 seconds to display a reminder of the amount of free disk space remaining on the SD Card and allow camera vibrations to subside.

    Until the DOW and Time range criteria are met, the info that will be displayed will look something like this:

          180 shots at 1m 15s
          S M T W T F S
          1 2 3 4 5 6 7:  145
          Hours (11:30-11:40)
          Waiting...

    After each shot, the screen will refresh the setup info and the last shot number and the actual time it was taken. The time indicated in the EXIF data of each JPG may indicate times that are one or more seconds later. This is due to the length of the exposure + processing + the time required to save to the SD Card.

          180 shots at 1m 15s
          S M T W T F S
          1 2 3 4 5 6 7:  145
          Hours (11:30-11:40)
          Last: 8 Sun at 11:40:0

    The DOWs are indicated to the right of the numbers below the days of the week. In the example above, the days of the week to shoot photos is indicated as "145" which means that on Sunday, Wednesday & Thursday the script will shoot photos during the hours chosen using the Start and End time parameters.

    Since there is no capability to print with "pretty" formats in UBasic, characters & numbers cannot be easily displayed so we need to accept what is available. In the example above the "Last: 8 Sun at 11:40:0" looks "nice", however they will look odd 3 minutes after midnight (Last: 8 Sun at 0:0:3). Similar formatting will be apparent in the "Hours (11:30-11:45)" such as "Hours (0:3-23:58)".

    The "shoot" command waits for the camera to perform some normally automatic actions, such as auto-focusing, charging the flash, etc. The "shoot" command in an intervalometer script allows it to compensate for all the things that can change over the course of many minutes and hours. In dim light it can sometimes take 2 or more seconds for a camera to hunt for focus. If you are planning on using this script to set auto-focus in low-light conditions, it would be good to change the 600 of the "sleep 600" command to a value from 1500 to 2500.

    The shortest interval of time between shots is dependent upon many factors: shutter speed, size of photos, model of camera, if RAW is chosen, using bracketing for exposures (HDR), how much processing is done on the JPGs, etc.

    Save the script as a *.BAS file and place in the CHDK/SCRIPTS folder to use.

    <<<< Part 1 of 2 >>>>
    « Last Edit: 09 / May / 2012, 16:20:49 by SkyWalker9 »

    *

    Offline SkyWalker9

    • ****
    • 301
    • SX20 IS (fw 1.02b)
  • Publish
    [<<<< Part 2 of 2 >>>>

    Code: [Select]
    rem Author SkyWalker9
    @title Selective Intervalometer
    @param a Number of Shots
    @default a 180
    @param e Interval (mins)
    @default e 5
    @param f Interval (secs)
    @default f 0
    @param p Starting Hour (24 Hr time)
    @default p 7
    @param q Starting Minute
    @default q 0
    @param r Ending Hour (24 Hr time)
    @default r 18
    @param s Ending Minute
    @default s 0

    rem Check input variables for proper values
      if a<0 then a=2
      if e<0 then e=0
      if f<0 then f=0
      if p<0 then p=0
      if p>23 then p=23
      if q<0 then q=0
      if q>59 then q=59
      if r<0 then r=0
      if r>23 then r=23
      if s<0 then s=0
      if s>59 then s=59

    rem Calculate user specified cycle/interval time in ms
      d=(e*600+f*10)*100
      if d<1 then d=1

    rem Next two statements combine "hour" and "minutes" (hour:11 minute:30 = 1130)
    rem This reduces the number of "if" statements required in "check_time" subroutine
      P=p*100+q
      R=r*100+s

    rem Print Error message if Start Time is after End Time print msg & exit
      if r>=p then goto "ok1"
        print "START Time after END"
        end
    :ok1

    rem Print message if Start Day of Week is after End Day of Week print msg & exit
      if v>=u then goto "ok2"
        print "START DOW after END"
        end
    :ok2

    rem this section selects each day of week (DOW) & packs the DOWs into the single variable L

      L=0
      for i = 1 to 7
        cls
        print "Left=No  Right=Yes"
        print "Set when done"
        select i
          case 1; print "Sun: No"
          case 2; print "Mon: No"
          case 3; print "Tue: No"
          case 4; print "Wed: No"
          case 5; print "Thu: No"
          case 6; print "Fri: No"
          case 7; print "Sat: No"
        end_select
        K=0
        gosub "sel_choose"
        if K=0 then goto "sel_off"
          L=L*10+i
    :sel_off
      next i
      goto "sel_fini"

    rem This subroutine lets user decide which Days of the week to use in script
    rem option K  0=No 1=Yes

    :sel_choose
      wait_click 10000
      is_key k "left"
      if k=1 then let K=0
      is_key k "right"
      if k=1 then let K=1
      is_key k "set"
      if k=1 then goto "sel_exit"
      cls
      print "Left=No  Right=Yes"
      print "Set when done"
      if K<>0 then goto "sel_opt_on"
      select i
        case 1; print "Sun: No"
        case 2; print "Mon: No"
        case 3; print "Tue: No"
        case 4; print "Wed: No"
        case 5; print "Thu: No"
        case 6; print "Fri: No"
        case 7; print "Sat: No"
      end_select
      goto "sel_redo"
    :sel_opt_on
      select i
        case 1; print "Sun: Yes"
        case 2; print "Mon: Yes"
        case 3; print "Tue: Yes"
        case 4; print "Wed: Yes"
        case 5; print "Thu: Yes"
        case 6; print "Fri: Yes"
        case 7; print "Sat: Yes"
      end_select
    :sel_redo
      goto "sel_choose"
    :sel_exit
      cls
      return

    :sel_fini

    rem Print a Caution message if Image Stabilization (IS) is enabled
      x=get_IS_mode
      if x<>3 then print "Caution: IS enabled"

    rem Displays the disk space/free disk space in MB & percent
      x=get_disk_size
      x=x/1000
      y=get_free_disk_space
      y=y/1000
      z=(y*100)/x
      print "Free Space "y"MB ("z"%)"

    rem Built in delay of 1000 ms to allow camera vibrations to stop plus 1000 ms
    rem to temporaily display the Caution msg if needed.
      sleep 2000

    rem Calculate length of total time period (1 min=60K "ticks"). This is done to
    rem allow use of "tick_count" instead of "sleep" statements. This results in more
    rem consistent/dependable/accurate interval cycles.
      N=((r*60+s)-(p*60+q))*60000

    rem This calculation corrects the length of time period above if the user starts
    rem the script during the DOWs & Start/End range they have selected
      O=N
      x=L
      gosub "dayofweek"
    :test_DOW1
       K=(x%10)-1
       if w=K then goto "change"
       x=x/10
       if x<1 then goto "ok3"
       goto "test_DOW1"
    :change
      F=get_time 2
      Q=get_time 1
      x=F*100+Q
      if x>=P and x<R then O=((r*60+s)-(F*60+Q))*60000
    :ok3

    rem Initializes shot counter; script shutdown camera when n=a in the "take_shots" section
      n=1

    rem -- Do not add comments after this point ---

      print a" Shots at "e"m "f"s"
      print "S M T W T F S"
      print "1 2 3 4 5 6 7: "L
      print "Hours "p":"q"-"r":"s
      print "Waiting..."
      
    :check_day
      gosub "dayofweek"
      x=L
    :test_DOW2
      K=(x%10)-1
      if w=K then goto "check_time"
      x=x/10
      if x<1 then goto "check_day"
      goto "test_DOW2"

    :check_time
      F=get_time 2
      Q=get_time 1
      F=F*100+Q
      if F>=P and F<R then goto "take_shots"
      goto "check_day"

    :take_shots
        i=get_tick_count
        i=i+O
    :more
        b=get_tick_count
        x=get_time 2
        y=get_time 1
        z=get_time 0
        shoot
        sleep 600
        W=w
        gosub "info"
        if n=a then shut_down
        n=n+1
        S=b+d
    :wait_loop
        b=get_tick_count
        if b<S then goto "wait_loop"
        if b<i then goto "more"
        O=N
        goto "check_day"

    :dayofweek
      D=get_time 3
      M=get_time 4
      Y=get_time 5
      A = (14-M)/12
      Y = Y-A
      M = M+12*A-2
      w = (D+Y+(Y/4)-(Y/100)+(Y/400)+(31*M/12))%7
      return

    :info
      cls
      print a" Shots at "e"m "f"s"
      print "S M T W T F S"
      print "1 2 3 4 5 6 7: "L
      print "Hours "p":"q"-"r":"s
      select W
          case 0; print "Last:"n" Sun "x":"y":"z
          case 1; print "Last:"n" Mon "x":"y":"z
          case 2; print "Last:"n" Tue "x":"y":"z
          case 3; print "Last:"n" Wed "x":"y":"z
          case 4; print "Last:"n" Thu "x":"y":"z
          case 5; print "Last:"n" Fri "x":"y":"z
          case 6; print "Last:"n" Sat "x":"y":"z
      end_select
      return
      
    end

    Update 4-19-11: When using the wait_click statements, some cameras require the timeout be specified; recommend starting with "wait_click 10000" (10secs). The script has been updated to reflect the change.
    « Last Edit: 11 / July / 2011, 11:15:16 by SkyWalker9 »

    *

    Offline SkyWalker9

    • ****
    • 301
    • SX20 IS (fw 1.02b)
  • Publish
    This is an update to the initial script posted. This upgrade allows setting the number of days the script should run.

    This script was designed for high accuracy and flexibility in mind. The script provides the ability to select shooting sequences by 1) number of days to run 2) specific days of the week 3) hours/minutes of the day, and 4) specific interval/cycles in minutes/seconds.

    Having the ability to individually select only the days of the week can save substantial amounts of SD card space and the need for deleting unwanted photos later. For example, lets say you only wanted to shoot photos on Monday, Wednesday & Friday. Using this script versus a "range" script  you would  not have a series of photos from Tuesday & Thursday that wasted space on your SD card  and you would realize a 40% savings in space requirements. You are still be able to select a "range of days" similar to a "range" intervalometer script simply by selecting all of the days of the week in the "range".

    This script also provides the user with the capability to set the number of days the script is to run. If you do not want to set a specific range of days, you can set the "Number of Shots" to 0 and the camera will shoot as many shots as can fit on the SD card. For example, if the "Number of Shots" is set to 0, the script will shoot the maximum number of shots using the interval, days of week, and the hours/minutes selected during the dates indicated. This avoids having to calculate the number of shots in the days time periods using the selected interval. It is left to the user to insure there will be enough free space available on the SD card (note: after entering the number of days the amount of disk free space is displayed in MB and percent available).

    Requirements/Recommendations.
    - No camera specific statements are used so this script should work on most CHDK equiped cameras
    - Requires ability to use Left, Right, and Set buttons on camera
    - Ensure Date & Times are set properly on your camera; script uses 24 hour times
    - Due to the normally long time sequences, an AC adapter and tripod are recommended

    Script termination.
    There are bacically four ways to exit this script:
    - Set the number of days to run
    - Set the number of shots to greater than 1
    - Too many shots for the remining free space on SD card; error message, camera remains on
    - Pressing the shutter button; usually used when user needs to change something, camera remains on

    Script Parameters:
    Number of Shots, Interval (mins), Interval (secs), Start Hour (24 Hr), Start Minute, End Hour (24 Hr), and End Minute

    Accuracy of interval times.
    Basically there are two different methods that intervalometer scripts usually employ for interval times, 1) reading/using the camera's built-in time clock and 2) using the CHDK "tick_count" statements. Using the camera's built-in time clock isn't as accurate as using the CHDK "tick_count" statements, therefore this script uses "tick_count" statements in order to keep the interval times very accurate.

    Error checking.
    As with most scripts, it is wise to do error checking on critical inputs provided by the user since intervalometer scripts usually run over longer time periods and involve shooting large numbers of photos. Therefore, this script tests critical inputs and where possible, corrects obvious errors so that the script can attempt to run. There is one error check that will terminate the script early - if the Start Time is set to occur after the End Time.

    Caution message.
    Since this script normally requires a tripod or hard surface, a Caution message will be displayed if the Image Stabilization (IS) is enabled. The IS mechanism operates by correcting shake. When there is no shake, or when the level of shake is below the threshold of the system's detection capability, use of the IS feature may actually add unwanted blur to the photograph, therefore you should shut it off in this situation.

    Entering "real-time" user input.
    One limitation of UBasic is that the size of the script appears to determine the maximum number of input parameters the script can display - small scripts can have more than larger scripts. Due to the size of this script, only 7 parameters could be used. However, this limitation was overcome by inputing data in "real time" during the running of the script. This method is used to enter the Number of days to shoot and Day Of the Week (DOW) user inputs.

    The Days of the Week (DOW) to shoot photos are entered in real time by the user after starting the script. For each day of the week, the user will be presented with "DOW" input messages looking like the following:

          Left=No  Right=Yes       Left(-)  Right(+)
          Set when done            Set when done
          Sun: No                  Number of days: 14
     
          Entering DOWs            Entering Number of days

    Use the "Right" or "Left" buttons to select yes or no, respectively, and when you are done press the "Set" button to proceed to the next day of the week. If you have chosen to use the Number of days (by setting number of shots to zero), then number of days will be entered in the same manner as the DOWs - in real time and using the Left, Right and Set buttons (see above example).

    <Part 1>
    « Last Edit: 09 / May / 2012, 16:31:28 by SkyWalker9 »

    *

    Offline SkyWalker9

    • ****
    • 301
    • SX20 IS (fw 1.02b)
  • Publish
    Once the DOWs have been input (and number of days if using this method), the script runs unattended until completion or if terminated early by the user by pressing the shutter button. After the last DOW or number of days entry, the script waits 2 seconds to display a reminder of the amount of free disk space remaining on the SD Card AND allow camera vibrations to subside.

    The initial display (after the remaining free space message) will look like this:

          180 shots at 1m 15s      2/14/11 +11 1m 15s
          S M T W T F S            S M T W T F S
          1 2 3 4 5 6 7:  145      1 2 3 4 5 6 7:  145
          Hours (11:30-11:40)      Hours (11:30-11:40)
          Waiting...               Waiting...
     
          Using #Shots            Using Number of days (#Shots set to 0)


    For each shot afterwards, the screen will redisplay the setup info with the last shot number and the DOW & time the camera shoots the photo. The time indicated in the JPG EXIF data will indicate a time that is one or more seconds later. This is due to the length of the exposure + processing + the time required to save to the SD Card.

          180 shots at 1m 15s      2/14/11 +11 1m 15s
          S M T W T F S            S M T W T F S
          1 2 3 4 5 6 7:  145      1 2 3 4 5 6 7:  145
          Hours (11:30-11:40)      Hours (11:30-11:40)
          Last: 8 Sun at 11:40:0   Last: 8 Sun at 11:40:0
     
          Using #Shots            Using Number of days (#Shots set to 0)

    The DOWs are indicated to the right of the numbers below the days of the week (In the example above, the days of the week to shoot photos is indicated as "145" which means that on Sunday, Wednesday & Thursday the script will shoot photos during the hours chosen using the Start and End time parameters.

    The Number of days display above "2/14/11 +11 1m 15s" indicates that 12 days were chosen for the script to run starting on that days date of "2/14/11" and running "+11" more days and at midnight the script will shutdown (if there are no photos scheduled for that DOW).
    If there are shots scheduled on the last day of the run, then the camera will shut down after the last shot. Therefore, if you have additional days after the last scheduled DOW, the camera will stay on during those days until midnight of the last day.

    Since UBasic doesn't have a capability to format the numbers when printing, numbers cannot be displayed with using a specific format, so we have to accept what is available. In the example above the time in "Last: 8 Sun at 11:40:0" looks "nice", however it will look odd 3 minutes after midnight (Last: 8 Sun at 0:0:3). Similar formatting will be apparent in the "Hours (11:30-11:45)" such as "Hours (0:3-23:58)".

    Miscellaneous Comments.
    The "shoot" command waits for the camera to perform some normally automatic actions, such as auto-focusing, charging the flash, etc. The "shoot" command in an intervalometer script allows it to compensate for all the things that can change over the course of many minutes/hours/days. In dim light it can sometimes take 2 or more seconds for a camera to hunt for focus. If you are planning on using this script to set auto-focus in low-light conditions, it would be good to change the 600 of the "sleep 600" command to a value from 1500 to 2500.

    The shortest interval of time between shots is dependent upon many factors: shutter speed, size/resolution of photos, model of camera, if RAW is chosen, using bracketing for exposures (HDR), the camera processing time for each JPG, class of SD card, etc.

    The mimimal interval time using my SX20 with a class 10 SD card in low light conditions were about 9 seconds. I expect this to vary by camera model, class of SD card, etc.

    Save the script as a *.BAS file and place in the CHDK/SCRIPTS folder to use.

    <Part 2>
    « Last Edit: 05 / April / 2011, 18:24:01 by SkyWalker9 »


    *

    Offline SkyWalker9

    • ****
    • 301
    • SX20 IS (fw 1.02b)
  • Publish
    Code: [Select]
    rem Author SkyWalker9
    @title Selective Intervalometer
    @param a Number of Shots
    @default a 10
    @param e Interval (mins)
    @default e 5
    @param f Interval (secs)
    @default f 0
    @param p Starting Hour (24 Hr)
    @default p 7
    @param q Starting Minute
    @default q 0
    @param r Ending Hour (24 Hr)
    @default r 18
    @param s Ending Minute
    @default s 0

    rem Check input variables for proper values
      if a<0 then a=2
      if e<0 then e=0
      if f<0 then f=0
      if p<0 then p=0
      if p>23 then p=23
      if q<0 then q=0
      if q>59 then q=59
      if r<0 then r=0
      if r>23 then r=23
      if s<0 then s=0
      if s>59 then s=59
      J=0

    rem Calculate user specified cycle/interval time in ms
      d=(e*600+f*10)*100
      if d<1 then d=1

    rem Next two statements combine "hour" and "minutes" (hour:11 minute:30 = 1130)
    rem This reduces the number of "if" statements required in "check_time" subroutine
      P=p*100+q
      R=r*100+s

    rem Print Error message if Start Time is after End Time print msg & exit
      if r>=p then goto "ok1"
        print "START Time after END"
        end
    :ok1

    rem this section selects each day of week (DOW) & packs the DOWs into the single variable L

      L=0
      for i = 1 to 7
        cls
        print "Left=No  Right=Yes"
        print "Set when done"
        select i
          case 1; print "Sun: No"
          case 2; print "Mon: No"
          case 3; print "Tue: No"
          case 4; print "Wed: No"
          case 5; print "Thu: No"
          case 6; print "Fri: No"
          case 7; print "Sat: No"
        end_select
        print " "
        K=0
        gosub "sel_choose"
        if K=0 then goto "sel_off"
          L=L*10+i
    :sel_off
      next i
      goto "sel_fini"

    rem This subroutine lets user decide which Days of the week to use in script
    rem option K  0=No 1=Yes

    :sel_choose
      wait_click 10000
      is_key k "left"
      if k=1 then let K=0
      is_key k "right"
      if k=1 then let K=1
      is_key k "set"
      if k=1 then goto "sel_exit"
      cls
      print "Left=No  Right=Yes"
      print "Set when done"
      if K<>0 then goto "sel_opt_on"
      select i
        case 1; print "Sun: No"
        case 2; print "Mon: No"
        case 3; print "Tue: No"
        case 4; print "Wed: No"
        case 5; print "Thu: No"
        case 6; print "Fri: No"
        case 7; print "Sat: No"
      end_select
      goto "sel_redo"
    :sel_opt_on
      select i
        case 1; print "Sun: Yes"
        case 2; print "Mon: Yes"
        case 3; print "Tue: Yes"
        case 4; print "Wed: Yes"
        case 5; print "Thu: Yes"
        case 6; print "Fri: Yes"
        case 7; print "Sat: Yes"
      end_select
    :sel_redo
      print " "
      goto "sel_choose"
    :sel_exit
      return

    :sel_fini

    if a<>0 then goto "bypass1"
    :v2_exit
      cls
      print "Left(-)  Right(+)"
      print "Set when done"
      print "Number of days: "J
      print " "
      wait_click 10000
      is_key k "left"
      if k=1 then let J=J-1
      is_key k "right"
      if k=1 then let J=J+1
      is_key k "set"
      if k=1 then goto "bypass1"
      if J<0 then let J=0
      goto "v2_exit"
    :bypass1
      cls

    rem Print a Caution message if Image Stabilization (IS) is enabled
      x=get_IS_mode
      if x<>3 then print "Caution: IS enabled"

    rem Displays the disk space/free disk space in MB & percent
      x=get_disk_size
      x=x/1000
      y=get_free_disk_space
      y=y/1000
      z=(y*100)/x
      print "Free Space "y"MB ("z"%)"
      print " "
      
    rem Built in delay of 1000 ms to allow camera vibrations to stop plus 1000 ms
    rem to temporaily display the Caution msg if needed.
      sleep 2000

    rem Calculate length of total time period (1 min=60K "ticks"). This is done to
    rem allow use of "tick_count" instead of "sleep" statements. This results in more
    rem consistent/dependable/accurate interval cycles.
      N=((r*60+s)-(p*60+q))*60000

    rem This calculation corrects the length of time period above if the user starts
    rem the script during the DOWs & Start/End range they have selected
      O=N
      x=L
      gosub "dayofweek"
    :test_DOW1
       K=(x%10)-1
       if w=K then goto "change"
       x=x/10
       if x<1 then goto "ok3"
       goto "test_DOW1"
    :change
      F=get_time 2
      Q=get_time 1
      x=F*100+Q
      if x>=P and x<R then O=((r*60+s)-(F*60+Q))*60000
    :ok3

    rem Initializes shot counter; script shutdown camera when n=a in the "take_shots" section
      n=1

    rem if Number of Days J<>0 then use Number of Days method; V counts up to J
      if J=0 then goto "bypass"
       gosub "dayofweek"  
       Y=get_time 5
       I=Y-2000
       H=D
       G=M
       v=w
       V=1
    :bypass

    rem -- Do not add comments after this point ---
      cls
      if J=0 then print a" Shots at "e"m "f"s" else print G"/"H"/"I" +"J-1" days "e"m "f"s"
      print "S M T W T F S"
      print "1 2 3 4 5 6 7: "L
      print "Hours "p":"q"-"r":"s
      print "Waiting..."
      
    :check_day
      gosub "dayofweek"
      x=L
      if J=0 then goto "test_DOW2"
      if w=v then goto "test_DOW2"
       V=V+1
       if V>J then shut_down
       v=w
      
    :test_DOW2
      K=(x%10)-1
      if w=K then goto "check_time"
      x=x/10
      if x<1 then goto "check_day"
      goto "test_DOW2"

    :check_time
      F=get_time 2
      Q=get_time 1
      F=F*100+Q
      if F>=P and F<R then goto "take_shots"
      goto "check_day"

    :take_shots
        i=get_tick_count
        i=i+O
    :more
        b=get_tick_count
        x=get_time 2
        y=get_time 1
        z=get_time 0
        shoot
        sleep 600
        W=w
        gosub "info"
        if n=a and J=0 then shut_down
        n=n+1
        S=b+d
    :wait_loop
        b=get_tick_count
        if b<S then goto "wait_loop"
        if b<i then goto "more"
        O=N
        if V=J then v=W+1
        goto "check_day"

    :dayofweek
      D=get_time 3
      M=get_time 4
      Y=get_time 5
      A = (14-M)/12
      Y = Y-A
      M = M+12*A-2
      w = (D+Y+(Y/4)-(Y/100)+(Y/400)+(31*M/12))%7
      return

    :info
      cls
      if J=0 then print a" Shots at "e"m "f"s" else print G"/"H"/"I" +"J-1" days "e"m "f"s"
      print "S M T W T F S"
      print "1 2 3 4 5 6 7: "L
      print "Hours "p":"q"-"r":"s
      select W
          case 0; print "Last:"n" Sun "x":"y":"z
          case 1; print "Last:"n" Mon "x":"y":"z
          case 2; print "Last:"n" Tue "x":"y":"z
          case 3; print "Last:"n" Wed "x":"y":"z
          case 4; print "Last:"n" Thu "x":"y":"z
          case 5; print "Last:"n" Fri "x":"y":"z
          case 6; print "Last:"n" Sat "x":"y":"z
      end_select
      return
      
    end

    Update 4-19-11: When using the wait_click statements, some cameras require the timeout be specified; recommend starting with "wait_click 10000" (10secs). The script has been updated to reflect the change.

    <Part 3 - final part>
    « Last Edit: 11 / July / 2011, 11:15:34 by SkyWalker9 »

  • Publish
    What happens when the memory card is full, or the file counter hits 9999?
    Also, when using the date/time schedule can the camera sleep while waiting for a valid time?
    Thanks!

    *

    Offline SkyWalker9

    • ****
    • 301
    • SX20 IS (fw 1.02b)
    « Last Edit: 20 / April / 2011, 17:50:08 by SkyWalker9 »

  • Publish
    I tried editing the script to remove the days of week check and just set L=1234567 but it locks up when I start the script.

    I also added this to the end of the :info subroutine
      y=get_free_disk_space
      if y<5000 then shut_down


    *

    Offline SkyWalker9

    • ****
    • 301
    • SX20 IS (fw 1.02b)
  • Publish
    I tried editing the script to remove the days of week check and just set L=1234567 but it locks up when I start the script.
    The lockup is probably due to the L=1234567 statement because in the current UBasic build it won't allow numbers greater than 999999 to be assigned to a variable directly. However there is a way around that by changing the L=1234567 to a expression that yields the same thing such as

    L=1234*1000+567.

    Quote
    I also added this to the end of the :info subroutine
      y=get_free_disk_space
      if y<5000 then shut_down

    Putting the statements at the beginning of the "Info" routine is a good place for the check. You can use your statements or use the following UBasic statements - either should work.

    y=get_jpg_count
      if y<3 then shut_down

    this statement uses the Canon algorithim to calculate the number of JPGs that will fit in the free space of the card.

  • Publish
    So I got a eyefi pro x2 with unlimited storage mode, and it seems to work fine for the most part.  However after a hour or so something happens and it quits transferring files until it is power-cycled.  Is there something I can add to the script that causes the camera to sleep (kill power to the memory card) every 30 minutes for a moment?  Effectively rebooting the eyefi card ever 30 minutes.

    I'm not sure what all modes cause the camera to kill power to the memory card.  Stand-by definitely does.

     

    Related Topics