/*******************************************************************************
 Function Name  : CGraphParameters
 Input(s)       : -
 Output         : -
 Functionality  : This function will Update global structure with the user
                  selected values.
 Member of      : CGraphParameters
 Author(s)      : Raja N
 Date Created   : 01.12.2004
 Modifications  : 
*******************************************************************************/
CGraphParameters::CGraphParameters()
{
    vInitialize();
}
Esempio n. 2
0
void main(void)
{
	vInitialize();
	myInit();
	
	while(!pushsw_get())
	{
		if(cnt1<100)
			led_out(0x1);
		else if(cnt1<200)
			led_out(0x2);
		else	cnt1 = 0;
	}
	cnt1 = 0;
	while(startbar_get())
	{
		if(cnt1<50)
			led_out(0x1);
		else if(cnt1<100)
			led_out(0x2);
		else	cnt1 = 0;
	}
	
	led_out(0);
	start();
	pattern = 10;	
	while(1)
	{

		switch(pattern)
		{

			case 10:	//直线
					if(check_crossline()){	pattern = 30;break;	}
					if(check_blackArea()){	pattern = 40;break;	}
					
					straight_run();				//直线前行,弯道检测,盲区检测
					break;
			
			case 20:	//弯道
						switch(turn_direction)
						{
							case LEFT:
									handle(-1*midDegree_st4);
									left_turn();
									break;
							case RIGHT:
									handle(midDegree_st4);
									right_turn();
									break;
							default:break;
						}
						break;


			case 30:	//直角

						rightAngle();						
						break;


			case 40:	//盲区
						switch(blackArea_direction)
						{
							case LEFT:
									left_blackArea();
									break;
							case RIGHT:
									right_blackArea();
									break;
							default:break;									
						}
						break;

			default:break;

		}//end switch

	}//end while
	
}