|
- #include "sys.h"
- #include "delay.h"
- #include "usart.h"
- #include "led.h"
- #include "lcd.h"
- #include "adc.h"
- //extern int temp1;
- int main(void)
- {
- //u16 adcx;
- float temp1;
- float temp2;
- NVIC_PriorityGroupConfig(NVIC_PriorityGroup_2);//设置系统中断优先级分组2
- delay_init(168); //初始化延时函数
- uart_init(115200); //初始化串口波特率为115200
- LED_Init(); //初始化LED
- Adc_Init(); //初始化ADC
- LCD_Init(); //初始化LCD FSMC接口
- while(1)
- {
- POINT_COLOR=RED;
- temp1 = get_num1();
- temp2 = get_num2();
- LCD_ShowString(30,120,170,24,24,"ADC1:");
- LCD_ShowNum(90,120,temp1,4,24);
- LCD_ShowString(30,140,170,24,24,"ADC2:");
- LCD_ShowNum(90,140,temp2,4,24);
- //printf("%f\n", temp1);
- printf("temp1:%f\n", temp1);
- printf("temp2:%f\n", temp2);
- LED1=!LED1;
- delay_ms(250);
- }
- }
复制代码
|
|