|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
| Thread Tools | Rate Thread | Display Modes |
|
#1
|
||||
|
||||
|
Purpose of "boot_initialization_flag" in 'camera.c'
I was wondering what the purpose is of boot_initialization_flag in camera.c is?
It seems like if take the flag out it would solve my problem of the camera not working after a robot reset, and having to turn to whole robot off before the camera works again... Code:
// stuff to do after the camera goes through a power-on reset
if(boot_initialization_flag == 1)
{
// get the camera's attention
Camera_Idle();
// set the command & packet transfer mode
Raw_Mode(5);
// don't execute this code again until the next power on reset
boot_initialization_flag = 0;
}
|
|
#2
|
|||
|
|||
|
Re: Purpose of "boot_initialization_flag" in 'camera.c'
So the code doesn't try to initalize the camera over and over.
That variable gets reset when you power cycle the robot controller anyway. One thing I have noticed, is that if the serial wire is loose, the camera acts very, very funny (Not picking up the reset commnads from the RC, for one).. If you are having that many problems, why not modify the code so it sends a couple of \n's to the camera before it tries to initalize it? It may be the camera has part of a command stuck in its buffer for some reason. |
|
#3
|
||||
|
||||
|
Re: Purpose of "boot_initialization_flag" in 'camera.c'
Quote:
Quote:
Since i dont have a robot now, i cant printf it out to see if it gets reset or not |
|
#4
|
|||
|
|||
|
Re: Purpose of "boot_initialization_flag" in 'camera.c'
If you go through the logic in that function, you find that Raw_Mode(5) is the only thing that is not actually preformed again.. However, that function is something that should only need to be called once. All it does is set up the serial communication with the camera.
Here's the thing: Pressing the robot reset button on the OI is different then pressing it on the actual RC. On the RC, it actually kills power to it. On the OI, I believe it just resets the User Processor. If you have problems with the camera, it's probably better to use the one on the robot. Most of the problems we have seem to start on the camera, rather then the RC. (Camera always thinks it's locked on) So, I don't think that function would need to be called again to preform a soft-reset of the camera. |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Where can I find motor control in Camera.c? | sjung9442 | Programming | 3 | 31-01-2006 15:49 |
| Purpose of the _SIMULATOR macro? | lasindi | Programming | 1 | 14-01-2006 19:07 |
| Bumpers for a game purpose? | Andrew Blair | Rules/Strategy | 6 | 10-01-2006 13:08 |
| Losing focus on the purpose of FIRST.. someone bring me back | archiver | 2000 | 6 | 23-06-2002 22:56 |
| Did Team 505 do it on purpose | Elgin Clock | Regional Competitions | 4 | 31-03-2002 10:13 |