Ianuser
12-02-2007, 22:56
Ok, I want to make a button turn off the camera and then the same button turn on the camera. THis is what I have. (This is in the Default_Routine())
int now4; //for mapping p3_sw_aux2 to ON or OFF (reset CAMERA)
int last4; //for mapping p3_sw_aux2 to ON or OFF (reset CAMERA)
last4 = now4;
now3 = p3_sw_aux2;
some joystick stuff...then..
if((Get_Camera_State() == 0) && (now4 == 1) && (last4 == 0))
{
Restart_Camera(); //Sets Camera in Recieving Mode so it can be used.
}
if((Get_Camera_State() == 1) && (now4 == 1) && (last4 == 0))
{
Camera_Idle(); //Sets Camera in OFF Mode in case we need to stop chasing the light and go into manual mode to go back to home base or something
}
Will Camera_Idle() stop the Camera from functioning so the robot will no longer track the light? It does, right? Cuz it stops the initialization of it. So, doesn't Restart_Camera() do the opposite of Camera_Idle()? If not, please tell me if there's a way in which I can do this? Maybe I'm mapping the button incorrectly, but its not working, I know that.
p.s. The camera works fine (sorta, thats another story though), it just doesn't stop searching when I press the button. I want it to stop searching when I press the button.
int now4; //for mapping p3_sw_aux2 to ON or OFF (reset CAMERA)
int last4; //for mapping p3_sw_aux2 to ON or OFF (reset CAMERA)
last4 = now4;
now3 = p3_sw_aux2;
some joystick stuff...then..
if((Get_Camera_State() == 0) && (now4 == 1) && (last4 == 0))
{
Restart_Camera(); //Sets Camera in Recieving Mode so it can be used.
}
if((Get_Camera_State() == 1) && (now4 == 1) && (last4 == 0))
{
Camera_Idle(); //Sets Camera in OFF Mode in case we need to stop chasing the light and go into manual mode to go back to home base or something
}
Will Camera_Idle() stop the Camera from functioning so the robot will no longer track the light? It does, right? Cuz it stops the initialization of it. So, doesn't Restart_Camera() do the opposite of Camera_Idle()? If not, please tell me if there's a way in which I can do this? Maybe I'm mapping the button incorrectly, but its not working, I know that.
p.s. The camera works fine (sorta, thats another story though), it just doesn't stop searching when I press the button. I want it to stop searching when I press the button.