PDA

View Full Version : camera delays



MOUNTAIN747
- 26th January 2010, 18:14
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!


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

ardhuru
- 26th January 2010, 18:29
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

Darrel Taylor
- 26th January 2010, 19:05
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>

MOUNTAIN747
- 26th January 2010, 20:14
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.

ardhuru
- 27th January 2010, 06:16
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