#include "led.h"
#include "delay.h"
#include "key.h"
#include "sys.h"
#include "lcd.h"
#include "usart.h"
#include "tsensor.h"
int main(void)
{
short temp;
delay_init(); //延时函数初始化
NVIC_PriorityGroupConfig(NVIC_PriorityGroup_2);//设置中断优先级分组为组2:2位抢占优先级,2位响应优先级
uart_init(115200); //串口初始化为115200
LED_Init(); //初始化与LED连接的硬件接口
LCD_Init(); //初始化LCD
T_Adc_Init(); //ADC初始化
POINT_COLOR=RED;//设置字体为红色
LCD_ShowString(30,50,200,16,16,"WarShip STM32");
LCD_ShowString(30,70,200,16,16,"Temperature TEST");
LCD_ShowString(30,90,200,16,16,"ATOM@ALIENTEK");
LCD_ShowString(30,110,200,16,16,"2015/1/14");
POINT_COLOR=BLUE;//设置字体为蓝色
LCD_ShowString(30,140,200,16,16,"TEMPERATE: 00.00C");
while(1)
{
temp=Get_Temprate(); //得到温度值
if(temp<0)
{
temp=-temp;
LCD_ShowString(30+10*8,140,16,16,16,"-"); //显示负号
}else LCD_ShowString(30+10*8,140,16,16,16," "); //无符号
LCD_ShowxNum(30+11*8,140,temp/100,2,16,0); //显示整数部分
LCD_ShowxNum(30+14*8,140,temp%100,2,16, 0X80); //显示小数部分
LED0=!LED0;
delay_ms(250);
}
}
|