camera delays


Closed Thread
Results 1 to 5 of 5

Thread: camera delays

  1. #1
    Join Date
    Jan 2009
    Location
    Alabama,USA
    Posts
    219

    Default camera delays

    I am converting my old digital camera into a time laps camera using an 8 bit dip switch on PortB of a 16F84A to set the delay between frames. I want to use the Sleep command for delay times longer than two seconds. PortA will control the camera trigger switch, and for longer delays the power switch is controlled. I thought my code looked good until I tried to compile… So much for looks!

    I get these Errors in the Select Case portion of the code;

    C/pbp/pbppic14.lib 47 : [226] Numeric Constant or Symbol Name Expected
    C/pbp/pbppic14.lib 47 : [201] ‘)’ Expected

    These two error lines show up numerous times in the Select Case portion of the code until the last line says “too many errors”.

    I have looked over Select Case command and I can’t see any problem. DelayMode is a Variable for PortB; Smode is a Word Variable to be used with the Sleep command. Sleep command line is not committed in the error messages. Got Me!
    I'm know I haven't set the Header yet but I don't think that should be a problem at this time. I hope someone can spot some stupid error I overlooked. Comments please!

    Code:
     define osc 4
    ;   
    PowerSW     var     PortA.0
    CameraTrig  var     PortA.1
    DelayMode   var     PortB
    AVAR        VAR     BYTE        ;General variable
    Bvar        var     byte
    SMode       var     word        ;var holds convertion for sleep command 
    MAXPIX      VAR     BYTE      ;Maxumn number of pictues per memory available
    ;	      Set Hardware 
        OPTION_REG.7=0		' Enable Weak Pull-Ups	'
    	TRISA=%00000000     ' PORTA all set to RA0-RA3 input, RA4-RA7 output 
    	TRISB=%11111111		' PORTB all set to input
    
    ;XXXXXXXXXXXXXXX  Main Program Area  XXXXXXXXXXXXXX
    
    ;                        WEAK PULLUPS ??? 
        MAXPIX=150     ;make adjustment to this number based on test of memory
        low PowerSW
        select case Delaymode    ;MODE of delay based on input read 
                case 1          ;one second mode
                      bvar=1000
                      goto MODE1                  
                case 2         ;two second mode
                      Bvar=2000
                      goto MODE1                     
                case 4          ;thirty second mode
                      smode = 30
                      goto MODE2                                                       
                case 8          ;one minute mode
                      smode = 60
                      goto MODE3                                         
                case 16         ;five minute mode
                      smode = 300
                      goto MODE3                                       
                case 32         ;15 minute mode
                      smode = 900
                      goto MODE3                                      
                case 64         ;one hour mode
                      smode = 3600
                      goto MODE3 
                case 128       ;three hour mode
                      smode = 10800
                      goto MODE3                                    
        end select        
    MODE1:
        FOR AVAR=1 TO MAXPIX    ; from 1 to Maxumn number of pictues per memory available
            HIGH    CameraTrig  ;gate trigger
            PAUSE 10            ;time for trigger pulse to settle
            LOW     CameraTrig  ;clear trigger
        pause bvar
        NEXT AVAR
        goto Shutdown    
    MODE2:          ;uses Sleep command
        FOR AVAR=1 TO MAXPIX    ; from 1 to Maxumn number of pictues per memory available
            HIGH    CameraTrig  ;gate trigger
            PAUSE 10            ;time for trigger pulse to settle
            LOW     CameraTrig  ;clear trigger 
            sleep smode
        NEXT AVAR
        goto Shutdown  
    MODE3:          ;powers camera on and off each fram - uses Sleep command
        high PowerSW
        FOR AVAR=1 TO MAXPIX    ; from 1 to Maxumn number of pictues per memory available
            HIGH    CameraTrig  ;gate trigger
            PAUSE 10            ;time for trigger pulse to settle
            LOW     CameraTrig  ;clear trigger
            low     PowerSW 
            sleep smode
            high    PowerSW 
        NEXT AVAR
    Shutdown:       ;end program and go to low power  
            end

  2. #2
    Join Date
    Oct 2004
    Posts
    448


    Did you find this post helpful? Yes | No

    Default

    Just in case your camera happens to be a Canon, there's an elegant software-only solution that would give you an intervalometer and a lot more.

    http://chdk.wikia.com/wiki/CHDK_in_Brief

    Regards,

    Anand

  3. #3
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959


    Did you find this post helpful? Yes | No

    Default

    I get these Errors in the Select Case portion of the code;

    C/pbp/pbppic14.lib 47 : [226] Numeric Constant or Symbol Name Expected
    C/pbp/pbppic14.lib 47 : [201] ‘)’ Expected
    Compiles without error here.

    Which version of PBP are you using?
    <br>
    DT

  4. #4
    Join Date
    Jan 2009
    Location
    Alabama,USA
    Posts
    219


    Did you find this post helpful? Yes | No

    Default Replay

    After two hours of trying to solve the compile problem (with PBP2.60) I posted my question and turned off the computer for lunch. On return I read DT's comment and tried again. This time it worked (which now concerns me). Man, Darrel your good! I have no idea what happend beside loosing two hours. I guess the hard drive has polterbytes. Thanks again guys for your comments, and yes it is a Canon. I'll give the site a look.

  5. #5
    Join Date
    Oct 2004
    Posts
    448


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by MOUNTAIN747 View Post
    and yes it is a Canon. I'll give the site a look.
    In fact, I'd urge everybody on the forum owning a Canon to check this out; its fantastic. Remote shutter control, motion detection, ultra high speed, loong exposures, time lapse, bracketing, the works. And the tool is scriptable too.

    Regards,

    Anand

Similar Threads

  1. PICs can do more if use others than delays instructions
    By hardcore in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 24th February 2010, 19:52
  2. Replies: 2
    Last Post: - 8th February 2009, 05:10
  3. Camera with PIC chip
    By The Master in forum Off Topic
    Replies: 5
    Last Post: - 1st July 2008, 14:28
  4. 12F629 Strange interupt behavior
    By BGreen in forum mel PIC BASIC Pro
    Replies: 8
    Last Post: - 25th May 2007, 15:35
  5. Camera interfacing PC help
    By Koraki in forum mel PIC BASIC Pro
    Replies: 0
    Last Post: - 13th September 2005, 17:49

Members who have read this thread : 1

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts