I am missing the first pic .After the board turns the cam on it wont take a pic till it senses motion the second time then it works great after that . what needs to be changed in the code to correct it .Oh i'm running a p52 with a v2600 slave.Here's the code I'm using.

'Look for lines marked with ***. These areas are where timings may need changed for different 'camera setups.

'=====================================================Main: ' Main loop that checks for a PIR event, charges slave, turns off the cam if in trail mode and increments counters & timers, then sleeps for 15 secs and does it all over again:'=====================================================Setintflags %00000100,%00000100 'enable interrupt flagsIf PIR_Event = 1 Then GoSub PIR_INTService

' Turn off walk test if time is up If WlkTestFlag = 1 And WlkTestTime = 0 ThenWlkTestFlag = 0 'turn off walk test If Time is upByte_Var = 0 ' Flash LED to indicate walk test over For Byte_Var = 0 To 7pause 400Toggle LED_OutNextPause 3000 ' pause so CdsCHK does not see led and think it's day timeEndIf

PIR_Event = 0 ; +++++++ Now See how long the port is high ++++++++++++++Byte_Var = 0 'clear the counterDo While Pinb.1= 1 'While the PIR is high (motion detected)Inc Byte_Var 'Inc our counter'Pause 1 'un-comment for a longer periodIf Byte_Var >= 2 Then ValidPIR = 1 'flag the motion detected as validExitEndIf Loop

If WlkTestFlag = 0 Then GoSub CamPWR ' Turn the camera on for the first timePause 1500 ' *** Change time here for different cameras *** If night_flag = 1 then Gosub Fire_Flash Else Gosub Shutter EndIfpause 4000 '*** delay after pic is taken to save picture. Change if needed ***Gosub Activity

CdsChk:High CDS_Out 'Turn on pin to supply voltage to cds voltage dividerreadadc 10 , CDS_Value ' Read light value'sertxd ("CDS Value ",#CDS_Value,13,10)'IF Night_Flag IS SET THEN WE CHECK TO SEE IF THE LIGHT LEVEL IS > = 144 IF ADC GREATER OR = THEN STILL DARK AND EXIT'IF ITS BELOW 144 THEN WE CLEAR NITEFLG AND RETURN'IF Night_Flag = 0 THEN CHECK TO SEE IF ADC ABOVE 155 THEN WE SET NITEFLG AND RETURNLow CDS_Out 'Turn off voltage dividerIf Night_Flag = 1 And CDS_Value >= Day ThenGoTo CdsChk_Exit 'already set and Still dark so we exitElseNight_Flag = 0 ' already set and Daylight so clear flagEndIfIf Night_Flag = 0 And CDS_Value >= Night ThenNight_Flag = 1 ' Its dark so set flagGosub Slave_Charge ' Charge the slave up alsoElseNight_Flag = 0 ' Daylight so clear flagEndIfCdsChk_Exit:

Return

Slave_Charge:High Flash_ChargePause 10000 ' *** Time slave is on during refresh ***Low Flash_ChargeReturn

RefreshCam:Gosub CamPWRpause 4000 '*** Time cam is on during refresh at night ***Gosub CamPWRReturn

Success!!! By changing the time to 1600 it works great. In real time is this 1.6 seconds? The AIO boards are a lot of fun to work on but I have lost a lot of hair working on them. Thanks Mr Bowgod02 and JDH

Who is online

You cannot post new topics in this forumYou cannot reply to topics in this forumYou cannot edit your posts in this forumYou cannot delete your posts in this forumYou cannot post attachments in this forum