Log in

View Full Version : default camera code edit


Windward
21-01-2006, 16:41
Does the default code for the camera (MPLab) have some sort of setting or special function that prevents programmers from adding their own code? The camera code runs perfectly (as far as we can tell anyway), but our code that we added to the file under Default_Routine (which worked on other default codes) doesn't work now. Is there something we are supposed to change or do?

scitobor 617
21-01-2006, 17:02
Make sure that you call the Default_Routine from the Process_Data_From_Master_uP function, it is commented out in the default camera code.

Windward
21-01-2006, 17:15
Make sure that you call the Default_Routine from the Process_Data_From_Master_uP function, it is commented out in the default camera code.

Mine isn't commented out.

Kevin Watson
21-01-2006, 17:41
Mine isn't commented out.As pointed out above, the *call* to default_routine() from Process_Data_From_Master_uP() is probably still commented out. This is done for safety reasons. Also make sure that code in default_routine() doesn't modify the camera's pan and tilt PWM values.

-Kevin

Windward
21-01-2006, 18:11
As pointed out above, the *call* to default_routine() from Process_Data_From_Master_uP() is probably still commented out. This is done for safety reasons. Also make sure that code in default_routine() doesn't modify the camera's pan and tilt PWM values.

-Kevin

As I said, I checked in main.c and it is not commented out, unless it is called another time which I didn't check.

scitobor 617
21-01-2006, 19:17
As I said, I checked in main.c and it is not commented out, unless it is called another time which I didn't check.

It, default_routine(), should be called from user_routines.c by the function Process_Data_From_Master_uP(). Another way to make modifications is to just edit Process_Data_From_Master_uP().

Jared Russell
21-01-2006, 20:31
Also make sure you aren't calling any other functions that modify PWM values after Default_Routines().

Windward
25-01-2006, 18:11
My bad. Turns out it was commented out somewhere else (or I went without sleep to long).

When I uncommented Default_Routine(), the camera started acting strange. The pwms would switch numbers back and forth such that the camera was vibrating.

I checked the code to see if it changed the pwms for the camera, and didn't find anything.

Andrew Blair
25-01-2006, 18:33
Trouble is, in that Default_routine function you uncommented, there are other things that control pwm01 and pwm02. So you, at the top of default_routine, just delete those two lines of code that modify pwm01 and pwm02.