Quote:
Originally Posted by stevethetinker
I've tried using the VW command while the camera is streaming data (T packets from Track Color), and often it seems to shut the camera down.
What are the rules for sending a command to the camera? Call Camera_Idle first? Wait for an ACK?
I tried adding a state to Kevin's code between STATE_TWO and STATE_THREE, and the first call to Write_Camera_Module_Register times out. (no ACK returned). That's all I did - add a no-action state. (I want to put a Poll Mode command there but that didn't work so I took out the command and its wait for ack, thus adding a no-action state).
|
Yes, you need to call Camera_Idle( ) before calling Virtual_Window( ), waiting for ACKs after each.
If you want to call Virtual_Window( ) from the initialization function, this is a fragment from some code I'm working on:
Code:
case STATE_SIXTEEN:
// initialize the Noise Filter value
Noise_Filter(Camera_Config_Data.NF);
// next state
state = STATE_SEVENTEEN;
// wait for an ACK before transitioning to the next state
wait_for_ack =1;
break;
case STATE_SEVENTEEN:
// set window size
Virtual_Window(60, 100, 100, 239);
// next state
state = STATE_EIGHTEEN;
// wait for an ACK before transitioning to the next state
wait_for_ack =1;
break;
case STATE_EIGHTEEN:
// send the TC or Track Color command
Track_Color(Camera_Config_Data.R_Min,
Camera_Config_Data.R_Max,
Camera_Config_Data.G_Min,
Camera_Config_Data.G_Max,
Camera_Config_Data.B_Min,
Camera_Config_Data.B_Max);
// next state
state = STATE_NINETEEN;
// wait for an ACK before transitioning to the next state
wait_for_ack =1;
break;
case STATE_NINETEEN:
// signal that we're done
return_value =1;
break;
-Kevin