Page 191 - 완) I MDP 프로젝트 작품 보고서(전체과 1학년)1.6
P. 191
Traffic_Phase=0; //go to First
Phase.
}
}
void TIM2_IRQHandler(void)
{
TIM_ClearITPendingBit (TIM2,TIM_IT_Update);
if(SCM1==1) //if Speed counter is Enabled
Scount1++; //count to measure Speed of Car
if(SCM2==1)
Scount2++;
}
void TL(void)
{
if(Traffic_Phase == 0) //RED
{
CarYelOff;
CarRedOn;
HumanRedOff;
HumanBluOn;
Stop = 1; //it's time to stop
}
else if(Traffic_Phase == 1)
{
}
else if(Traffic_Phase ==2 ) //Blue
{
CarRedOff;
CarBluOn;
HumanBluOff;
- 184 -