Page 201 - 완) I MDP 프로젝트 작품 보고서(전체과 1학년)1.6
P. 201
GPIO_InitStructure.GPIO_Pin = GPIO_Pin_All;
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_IN_FLOATING;
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;
GPIO_Init(GPIOF,&GPIO_InitStructure);
//Main_Cds
GPIO_InitStructure.GPIO_Pin = GPIO_Pin_0;
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_IN_FLOATING;
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;
GPIO_Init(GPIOD,&GPIO_InitStructure);
//Follow Light
GPIO_InitStructure.GPIO_Pin = GPIO_Pin_15 | GPIO_Pin_14 | GPIO_Pin_13 |
GPIO_Pin_12;
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_Out_PP;
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;
GPIO_Init(GPIOF,&GPIO_InitStructure);
}
static void GLCD_Ready(void)
{
GLCD_init(); //GLCD Initialize
GLCD_clear(White); //Set Background Color and Clear display
GLCD_setTextColor(Blue); //Set Font's color
static void Init_TIM_TL(void) //Timer for Traffic Light
{
TIM_TimeBaseInitTypeDef TIM_TimeBaseStructure;
TIM_TimeBaseStructure.TIM_Period = 5000;
//this counter count to 5000 and clear so 5000ns == 5ms
TIM_TimeBaseStructure.TIM_Prescaler = 72-1;
//Prescale 72 so 72Mhz Become to 1Mhz == 1ns
TIM_TimeBaseStructure.TIM_ClockDivision = 0;
TIM_TimeBaseStructure.TIM_CounterMode = TIM_CounterMode_Up; //Upcounter
TIM_TimeBaseInit(TIM3,&TIM_TimeBaseStructure); //apply Setting
- 194 -