-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathmain.c
executable file
·55 lines (49 loc) · 1.26 KB
/
main.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
#include "stm32f10x.h"
#include "core_cm3.h"
#include "led.h"
#include "sys.h"
#include "usart.h"
#include "delay.h"
#include "adc.h"
#include "LCD.h"
#include "exti.h"
#include "spi_tft.h"
int main(void) {
Stm32_Clock_Init(9); //系统时钟设置72M
delay_init(72); //延时初始化
uart_init(72,115200); //串口1初始化
LCD_Init(); //LCD初始化
LED_Init();
EXTI_Init();
//Lcd_Initialize();
Adc_Init();
int flag = 0;
while(1) {
switch(flag % 3) {
case 0:
LCD_Clear(RED);
POINT_COLOR = WHITE;
BACK_COLOR = BLACK;
LCD_ShowString(0,0,240,320,16,"red");
LED0 = 1;
break;
case 1:
LCD_Clear(GREEN);
POINT_COLOR = WHITE;
BACK_COLOR = BLACK;
LCD_ShowString(0,0,240,320,16,"green");
LED1 = 1;
break;
case 2:
LCD_Clear(BLUE);
POINT_COLOR = WHITE;
BACK_COLOR = BLACK;
LCD_ShowString(0,0,240,320,16,"blue");
LED0 = 0;
LED1 = 0;
break;
}
flag++;
delay_ms(500);
}
}