2.4.6主要功能函数及注释
//组员信息
//LCD_DrawPicture(0,0,240,320,gImage_dage);
Draw_Text_8_16_Str(0,0,BLUE,GREEN,\嵌入式软件16-01\Draw_Text_8_16_Str(0,25,BLUE,GREEN,\姓名 学号 \Draw_Text_8_16_Str(0,50,BLUE,GREEN,\张凯 44\Draw_Text_8_16_Str(0,75,BLUE,GREEN,\郭志 Draw_Text_8_16_Str(0,100,BLUE,GREEN,\库任昊 Draw_Text_8_16_Str(0,125,BLUE,GREEN,\郑炳辉 Delay_ms(10000000); //画线
LCD_DrawLine( 0, 160, 240, 160, RED); LCD_DrawLine( 0, 0, 240, 320, RED); LCD_DrawLine( 240, 0, 0, 320, RED); LCD_DrawLine( 120, 0, 120, 320, RED); //画方
LCD_DrawLine( 60, 100, 180, 100, RED); LCD_DrawLine( 60, 220, 180, 220, RED); LCD_DrawLine( 60, 100, 60, 220, RED); LCD_DrawLine( 180, 100, 180,220, RED); //画圆
for(i=1;i<=360;i++) {
a=120+50*cos(i*3.141592/180); b=160+50*sin(i*3.141592/180); LCD_DrawPoint(a,b,RED); Delay_ms(20); }
9
15\52\ 10\ //动图圆
for(c=20;c<=40;c++) {
for(i=1;i<=360;i++) {
a=120+c*cos(i*3.141592/180); b=160+c*sin(i*3.141592/180); LCD_DrawPoint(a,b,RED); Delay_us(500); }
Delay_ms(1); }
for(c=40;c<=60;c++) {
for(i=1;i<=360;i++) {
a=120+c*cos(i*3.141592/180); b=160+c*sin(i*3.141592/180); LCD_DrawPoint(a,b,GREEN); Delay_us(100); }
Delay_ms(1); }
for(c=60;c<=65;c++) {
for(i=1;i<=360;i++) {
a=120+c*cos(i*3.141592/180); b=160+c*sin(i*3.141592/180); LCD_DrawPoint(a,b,YELLOW); Delay_us(500);
10
}
Delay_ms(1); }
for(c=65;c<=70;c++) {
for(i=1;i<=360;i++) {
a=120+c*cos(i*3.141592/180); b=160+c*sin(i*3.141592/180); LCD_DrawPoint(a,b,WHITE); Delay_ms(1); }
Delay_ms(1); }
for(c=70;c<=75;c++) {
for(i=1;i<=360;i++) {
a=120+c*cos(i*3.141592/180); b=160+c*sin(i*3.141592/180); LCD_DrawPoint(a,b,GREEN); Delay_us(500); }
Delay_ms(1); }
11
for(c=75;c<=80;c++) {
for(i=1;i<=360;i++) {
a=120+c*cos(i*3.141592/180); b=160+c*sin(i*3.141592/180); LCD_DrawPoint(a,b,RED); Delay_ms(1); }
Delay_ms(1); }
for(c=80;c<=100;c++) {
for(i=1;i<=360;i++) {
a=120+c*cos(i*3.141592/180); b=160+c*sin(i*3.141592/180); LCD_DrawPoint(a,b,BLACK); Delay_us(100); }
Delay_ms(1); }
for(c=100;c<=120;c++) {
for(i=1;i<=360;i++) {
a=120+c*cos(i*3.141592/180); b=160+c*sin(i*3.141592/180); LCD_DrawPoint(a,b,WHITE); Delay_us(500); }
12
Delay_ms(1); } Echo(); UART_Txet1(); u8 key;
key=KEY_Value(); if(key!=0xff) {
switch(key) {
case 1: GPIOB->ODR ^=(1<<5); break;
case 2: GPIOE->ODR ^=(1<<5); break;
case 3: GPIOA->ODR ^=(1<<5); break;
case 4: GPIOA->ODR ^=(1<<6); break; } }
时钟函数: for(i=1;i<=360;i=i+6) {
a=120+60*cos(i*3.141592/180); b=160+60*sin(i*3.141592/180);
LCD_DrawLine( 120, 160 , a, b, GREEN); Delay_ms(1000);
LCD_DrawLine( 120, 160 , a, b, WHITE); }
for(i=270,k=270,h=270;h<=630;i=i+6,t=t+1) {
a=120+60*sin(i*3.1415926/180); b=120+60*cos(i*3.1415926/180);
13