void Show_Wave_Fun(float MAX,float MIN,u16 OriginalPoint_X,u16 OriginalPoint_Y,float Volue,u16 high) //MAX:数据最大值, MIN:数据最小值, OriginalPoint_X:原点X, OriginalPoint_Y:原点Y坐标, Volue:数据值, high:坐标轴高度
{
u16 X,Y;
u8 i;
float Temp=0;
static u16 X_temp=0;
static u16 High=0;
static u16 Mode0_volue[200][1]={0};
POINT_COLOR=BLACK;
Temp = MAX-MIN;
High = high;
LCD_DrawLine(OriginalPoint_X,OriginalPoint_Y,200+OriginalPoint_X,OriginalPoint_Y);
if(OriginalPoint_Y>=High)
{
LCD_DrawLine(OriginalPoint_X,OriginalPoint_Y,OriginalPoint_X,OriginalPoint_Y-High);
}
else
{
LCD_DrawLine(OriginalPoint_X,OriginalPoint_Y,OriginalPoint_X,0);
}
Y=(u16)((Volue-MIN)*High/Temp);
for(i=0,X=OriginalPoint_X; i<=X_temp; X++,i++)
{
LCD_Fast_DrawPoint(X,OriginalPoint_Y - Mode0_volue[0],WHITE);
}
if(X_temp==200-1)
{
for(i=0;i<=X_temp;i++)
{
if(i+1<200)
Mode0_volue[0]=Mode0_volue[i+1][0];
}
}
Mode0_volue[X_temp][0]=Y;
for(i=0,X=OriginalPoint_X; i<=X_temp; X++,i++)
{
LCD_Fast_DrawPoint(X,(u16)(OriginalPoint_Y-Mode0_volue[0]),RED);
}
if(X_temp<200-1)
X_temp++;
} |