Page 900 - 완) I MDP 프로젝트 작품 보고서(전체과 1학년)1.6
P. 900
/* 인터럽트 라인 8번 라이징 엣지 설정 */
EXTI_InitStructure.EXTI_Line = EXTI_Line8;
EXTI_InitStructure.EXTI_Mode = EXTI_Mode_Interrupt;
EXTI_InitStructure.EXTI_Trigger = EXTI_Trigger_Rising;
EXTI_InitStructure.EXTI_LineCmd = ENABLE;
EXTI_Init(&EXTI_InitStructure);
/* 인터럽트 라인 9번 라이징 엣지 설정 */
EXTI_InitStructure.EXTI_Line = EXTI_Line9;
EXTI_InitStructure.EXTI_Mode = EXTI_Mode_Interrupt;
EXTI_InitStructure.EXTI_Trigger = EXTI_Trigger_Rising;
EXTI_InitStructure.EXTI_LineCmd = ENABLE;
EXTI_Init(&EXTI_InitStructure);
/* 인터럽트 라인 10번 라이징 엣지 설정 */
EXTI_InitStructure.EXTI_Line = EXTI_Line10;
EXTI_InitStructure.EXTI_Mode = EXTI_Mode_Interrupt;
EXTI_InitStructure.EXTI_Trigger = EXTI_Trigger_Rising;
EXTI_InitStructure.EXTI_LineCmd = ENABLE;
EXTI_Init(&EXTI_InitStructure);
while(1)
{
ADC_SoftwareStartConvCmd(ADC1, ENABLE);
// ADC 변환 시작
while(ADC_GetFlagStatus(ADC1, 0x2)==RESET);
// ADC 변환값이 들어오면 while문을 빠져나감
AD_value = ADC_GetConversionValue(ADC1);
// AD_value에 ADC변환값 대입
LCD_num(Line2, 100, AD_value);
// LCD에 ADC 변환값 디스플레이
if(PS==1) // 물체감지
{
- 893 -