Jump to content
Lv2Hunt

Anyone Want To Help With Picaxe Problem?

Recommended Posts

 
 

I tried something else.

At startup I have a camera test routine that powers on camera and charges slave and then turns everything off.

I commented out the camera part of the code.

 

And under the slaverefreshtimer part of the code in the main loop. When the timer timed out I made it go to camera_test which only had charge slave in it because I commented out the camera part.

 

And everything worked normal.

 

So after that I made a subroutine named slaverefresh and put it ahead of camer_test. When the timer times out I made it go to slave refresh and everything appears to be working.?????????????????

 

Makes no sense. Apparently where my subroutine goes makes a difference.

I am testing now to verify this.

Share this post


Link to post
Share on other sites
 

 

I don't think the GoSub Main has a <return> associated with it, and it's not needed anyway is it?

 

sleep 1 'pause for approx 2.1 sec

 

gosub CdsChk 'inital cds check

gosub main

 

'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

 

 

Share this post


Link to post
Share on other sites
 

You are correct. That is wrong it should be goto main but it's not needed at all since main is the next line.

Share this post


Link to post
Share on other sites
 

You were looking at my original code. My newest code in the Dropbox link I have already changed that.

Share this post


Link to post
Share on other sites
 

In the program in the dropbox link, if you put a small pause between the slave refresh and the loop in the Main I wonder if that would make a difference? Maybe it's checking the PIR to soon after the cap charges and it's causing the camera to trigger.

Share this post


Link to post
Share on other sites
 

Yes that's what I am playing with now. I think it needs a pause. I will let you know after some testing

Share this post


Link to post
Share on other sites
 

One more thing, not sure about the setfrq command and the M2 chips, it may not be necessary and may be causing some confusion internally. I'm thinking that the M2 chips have an auto adjust built in.

Share this post


Link to post
Share on other sites
 
One more thing, not sure about the setfrq command and the M2 chips, it may not be necessary and may be causing some confusion internally. I'm thinking that the M2 chips have an auto adjust built in.

 

After doing some reading I think maybe you are correct using the setfrq where you are. I think the auto adjust is for multitasking projects

Share this post


Link to post
Share on other sites
 

I am pretty sure I have fixed it but I'm still testing to confirm.

I added a pause between when the slave refresh timer times out and charging slave. I also added a pause after the slave charges before jumping back into the main loop.

Share this post


Link to post
Share on other sites
 

Good call JDH.

 

post-34-1404699577.jpg

Edited by ghoot

Share this post


Link to post
Share on other sites
 
 

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×