CritterGetter MICROv7.1 Standard Programming Type1-4

Post Reply
User avatar
FIREMANJIM
Posts: 783
Joined: Wed Aug 04, 2010 2:37 pm
Location: Decherd, Tennessee

CritterGetter MICROv7.1 Standard Programming Type1-4

Post by FIREMANJIM »

Any board ordered after 11-25-2016 with Standard Programming will have the ability to run all 4 camera types sellectable from DIPs 3 and 4 on the board. Dip 1 will control the delay if in feeder mode (DIP 2 OFF). DIP 2 controls feeder mode or trailmaster mode DIP 2 OFF = Feeder Mode ON = Trailmaster Mode

Code: Select all


#rem
CritterGetterMICROV7.1 Standard Programming Type 1-3 Feeder TrailMaster
DIP 1 Controls delay if in Feeder Mode DIP1 OFF = 1 Min Delay DIP1 ON = 6 Min Delay
DIP 2 Controls Feeder or TrailMaster Mode OFF = Feeder Mode  ON = TrailMaster Mode
DIP 3 and DIP 4 Controls Type of Camera Used
#endrem
symbol CDSPwr = b.0
symbol CDSRead = b.1
symbol LED = b.2
symbol Output2 = b.3
symbol CamPwr = b.4
symbol CamSht = b.5
symbol DIP1 = pinc.0
symbol TrailModeSelect = pinc.1
symbol DIP3 = pinc.2
symbol PIRInput = pinc.3
symbol DIP4 = pinc.4
 
symbol DayStatus = bit0
symbol CameraOn = bit1
symbol TrailMode = bit2
symbol Type4 = bit3

symbol DayLevel = b4
symbol DaySetting = b5
symbol NightSetting = b6
symbol Counter = b7

symbol TrailModeTimer = w9
symbol CameraRefreshTimer = w10
symbol CameraShutterDelay = w11
symbol CheckCDSTimer = w12
 
 
disablebod

low Output2
low CDSPwr
low LED
low CamPwr
low CamSht
' set input pins as inputs
Input c.0
Input c.1
Input c.2
Input c.3
Input c.4
 
' set default variable settings
CameraOn = 0
Type4 = 0 
DayStatus = 1
DaySetting = 127
NightSetting = 118
nap 5 	
'check to see what camera timings have been selected with DIPS 3 & 4
if DIP3 = 1 and DIP4 = 1 then	'type 1 camera selected 1.2 second shutter delay
	CameraShutterDelay = 1200
	Type4 = 0
endif
if DIP3 = 1 and DIP4 = 0 then	'type 2 camera selected 1.5 second shutter delay
	CameraShutterDelay = 1500
	Type4 = 0
endif
if DIP3 = 0 and DIP4 = 1 then	'type 3 camera selected 2.0 second shutter delay
	CameraShutterDelay = 2000
	Type4 = 0
endif
if DIP3 = 0 and DIP4 = 0 then	'type 4 camera selected 2.0 second shutter delay Panasonics
	CameraShutterDelay = 2000
	Type4 = 1
endif
Nap 5
'check if TrailMaster Mode dip switch is on or off
if TrailModeSelect = 1 then
                TrailMode = 0                              ' run in feeder mode
else
                TrailMode = 1                              ' run in trail mode
endif

'turn on camera to test and charge flash cap
         
      High LED
      Pause 1000
      high CamPwr
	pause 500
	If Type4 = 0 Then
		Low CamPwr
	EndIf
	CameraOn = 1
	pause 30000
      high CamPwr
      pause 500
      low CamPwr
	CameraOn = 0
      Pause 1000
      Low LED
	pause 1000
      CameraRefreshTimer = 0
      pause 1000
	high       CDSPwr                    ' apply power to CDS sensor
      nap 5     ' allow power to settle
      readadc                CDSRead, DayLevel
      low CDSPwr
      if DayLevel <= NightSetting then
            DayStatus = 0
		pause 500
      endif
      if DayLevel >= DaySetting then
		DayStatus = 1
		pause 500
	endif
	CheckCDSTimer = 0 
	pause 1000
	goto WalkTest
 
WalkTest:
      if PirInput = 1 then
		pause 40
		if PIRInput = 0 then
			goto WalkTest
		Endif
      	high LED
      	nap 6                     ' pause low power for 1.1 seconds
      	low LED
      	nap 8                     ' pause low power for 4 seconds
      	w13 = 0
      endif
      if W13 >= 208 then           ' approx 30 seconds 
            for Counter = 1 to 10
		high LED
		pause 200
		low LED
		pause 200
		next Counter
            pause 1000
		w13 = 0
            goto MainProgramLoop                            ' start main program loop
      endif 
      W13 = W13 + 1                   ' increment loop counter
	Nap 3
	goto WalkTest


                  
 
MainProgramLoop:
 
if PirInput = 1 then
	pause 40
	if PIRInput = 0 then
		goto MainProgramLoop
	EndIf

      if TrailMode = 0 then
            if CameraOn = 0 then     ' if camera is off turn it on
                  high CamPwr
                  pause 500
			If Type4 = 0 Then
				low CamPwr
			EndIf
			CameraOn = 1
                  pause CameraShutterDelay
		endif
            high CamSht                               ' Press Shutter Button to take picture
            pause 3000
            low CamSht
            pause 2500
            high CamPwr                 ' turn camera off in feeder mode
            pause 500
            low CamPwr
            CameraOn = 0
		TrailModeTimer = 0 
		CameraRefreshTimer = 0
		if DIP1 = 1 then	'pause 1 minute before looking for movement again
			sleep 27
		EndIf
		if DIP1 = 0 then	'pause for 6 minutes before looking for movement again
			sleep 157
		Endif
      endif
                                
                
      if TrailMode = 1 then
            if CameraOn = 0 then     ' if camera is off turn it on
                  high CamPwr
                  pause 500
			If Type4 = 0 Then
				low CamPwr
			endif
			CameraOn = 1
                  pause CameraShutterDelay
		EndIf
            high CamSht                               ' Press Shutter Button to take picture
            pause 3000
            low CamSht
            TrailModeTimer = 0
		CameraRefreshTimer = 0
		If DayStatus = 0 Then
			Sleep 3
		Else
			Pause 500
		EndIF
      endif
EndIf

if CameraOn = 1 then
TrailModeTimer = TrailModeTimer + 1    ' increment temporary counter for camera on time with no pir 
      if TrailModeTimer >= 210 then           ' camera timer set to about 30 seconds no activity
            high CamPwr ' turn camera off
            pause 500
            low CamPwr
            CameraOn = 0
            TrailModeTimer = 0
		CameraRefreshTimer = 0 
            pause 500 
      endif
endif

CameraRefreshTimer = CameraRefreshTimer + 1
if CameraRefreshTimer >= 25000 then
	If DayStatus = 0 Then
      	high CamPwr
      	pause 500
		If Type4 = 0 Then
			low CamPwr	
		EndIf
		pause 7000
      	high CamPwr
      	pause 500
      	low CamPwr
      	pause 500
	else
		pause 500
	EndIf
	CameraRefreshTimer = 0 
	Pause 500
EndIf
		 
CheckCDSTimer = CheckCDSTimer + 1
If CheckCDSTimer >= 2084 then
	high       CDSPwr                    ' apply power to CDS sensor
      nap 5     ' allow power to settle
      readadc                CDSRead, DayLevel
      low CDSPwr
      if DayLevel <= NightSetting then
            DayStatus = 0
		pause 500
      endif
      if DayLevel >= DaySetting then
		 DayStatus = 1
		 pause 500
	endif
	If CameraOn = 1 then
		high CamPwr
		pause 500
		Low CamPwr
		CameraOn = 0
	EndIf
	CheckCDSTimer = 0 
	pause 500
EndIf

Nap 3
Goto MainProgramLoop
Post Reply