|
设计要求:见图片
仿真原理图如下(proteus仿真工程文件可到本帖附件中下载)
uint8 x_1= 0,y_1 = 0;
uint8 x_2= 0,y_2 = 0;
uint8 x_3= 0,y_3 = 0;
uint8 x_4= 0,y_4 = 0;
uint8 x_5= 0,y_5 = 0;
uint8 t4_PianYi_x = 0,t4_PianYi_y = 0;
uint8 t5_PianYi_x = 0,t5_PianYi_y = 0;
int i = 0 ;
for( i= 0;i<t1*3;i++)
{ x_1 = 10+ i;
y_1 = bmp_PianYi_y-x_1*1;
GUI_DrawPoint(x_1,y_1-10,BLUE);//AD
GUI_DrawPoint(x_1,y_1,BRRED);
}
for( i=0;i<10;i++)
{
GUI_DrawPoint(x_1,200-i,BLACK);
}
Show_Str(x_1-(t1*3)/2,200,BLACK,GRAY,"t1",12,1);
x_2 = x_1;
y_2 = y_1;
for( i = 0;i<t2*3;i++ )
{
x_2 ++;
GUI_DrawPoint(x_2,y_2-10,BLUE);//AD
GUI_DrawPoint(x_2,y_2,BRRED);
}
for( i=0;i<10;i++)
{
GUI_DrawPoint(x_2,200-i,BLACK);
}
Show_Str(x_2-(t2*3)/2,200,BLACK,GRAY,"t2",12,1);
x_3=x_2; y_3 =y_2;
for( i= 0;i<t3*3;i++)
{
x_3 ++ ;
y_3 = y_3 - 1; //1ÎaÏμêy
GUI_DrawPoint(x_3,y_3-10,BLUE);//AD
GUI_DrawPoint(x_3,y_3,BRRED);
}
for( i=0;i<10;i++)
{
GUI_DrawPoint(x_3,200-i,BLACK);
}
Show_Str(x_3-(t3*3)/2,200,BLACK,GRAY,"t3",12,1);
t4_PianYi_x = x_3 + (t4*3)/2;
t4_PianYi_y = y_3 + (((t4/2)*3)*((t4/2)*3)*0.07);
for( i = - (t4/2)*3;i< (t4/2)*3 ; i++ )
{
x_4 = t4_PianYi_x+i;
y_4 = t4_PianYi_y+(- i*i*0.07);//1ÎaÏμêy
GUI_DrawPoint(x_4,y_4-10,BLUE);//AD
GUI_DrawPoint(x_4,y_4,BRRED);
}
for( i=0;i<10;i++)
{
GUI_DrawPoint(x_4,200-i,BLACK);
}
Show_Str(x_4-(t4*3)/2,200,BLACK,GRAY,"t4",12,1); t5_PianYi_x = x_4 + (t5*3)/2;
t5_PianYi_y = y_4 + pow(0.92, -(t5*3)/2);
// LCD_DrawLine(100, 10, 100, 200);
for( i = - (t5*3)/2;i< (t5*3)/2 ; i++ )
{
x_5= t5_PianYi_x + i;
y_5 = t5_PianYi_y - pow(0.92,i );
GUI_DrawPoint(x_5,y_5-10,BLUE);//AD
GUI_DrawPoint(x_5,y_5,BRRED);
}
for( i=0;i<10;i++)
{
GUI_DrawPoint(x_5,200-i,BLACK);
}
Show_Str(x_5-(t5*3)/2,200,BLACK,GRAY,"t5",12,1);
for(i = 0;i<10;i++ )
{GUI_DrawPoint(20+i,210,BLUE); Show_Str(30,210,BLUE,YELLOW,"AD",12,0); }
for(i = 0;i<10;i++ )
{GUI_DrawPoint(20+i,222,BRRED); Show_Str(30,222,BRRED,YELLOW,"DA",12,0); }
for(i= 0;i<10;i++)
{ GUI_DrawPoint(10+i,200-50,BLACK); Show_Str(0,200-50,BLACK,GRAY,"1",12,1); }
for(i= 0;i<10;i++)
{ GUI_DrawPoint(10+i,200-100,BLACK); Show_Str(0,200-100,BLACK,GRAY,"2",12,1); }
for(i= 0;i<10;i++)
{ GUI_DrawPoint(10+i,200-150,BLACK); Show_Str(0,200-150,BLACK,GRAY,"3",12,1); }
}
Keil代码与Proteus仿真下载(程序模拟示波器画面,无AD采集等功能 如果需要请自行添加):
kese1.7z
(367.91 KB, 下载次数: 215)
|
评分
-
查看全部评分
|