微波EDA网,见证研发工程师的成长!
首页 > 硬件设计 > 嵌入式设计 > ARM7学习---GPS练习

ARM7学习---GPS练习

时间:11-18 来源:互联网 点击:

LCD_write_LCD(0x80+x,0);//X轴地址
LCD_write_LCD(0x40+y+1,0);//Y轴地址
for(i=0;i<8;i++)
if(mirror==0)
{LCD_write_LCD(hanzi16[4*hz+2][i],1);}
else
{LCD_write_LCD(~hanzi16[4*hz+2][i],1);}
for(i=0;i<8;i++)
if(mirror==0)
{LCD_write_LCD(hanzi16[4*hz+3][i],1);}
else
{LCD_write_LCD(~hanzi16[4*hz+3][i],1);}
}
//////////////LCD指针坐标//////////////////////
void LCD_xy(uchar x,uchar y)
{
LCD_write_LCD(0x80+x,0);//X轴地址
LCD_write_LCD(0x40+y,0);//Y轴地址
}

//////////////////////////////////////////////////////////////

void GPS_display(void)
{
unsigned char i,j,n,m;
unsigned char hh,hl,mh,ml,sh,sl;
unsigned char temp_time;

LCD_xy(16,0);//LCD指针坐标

write_hanzi(7); //小
write_hanzi(8);//文
write_hanzi(0); //电
write_hanzi(11);//子

write_asicc(0);//空白
write_asicc(G);
write_asicc(P);
write_asicc(S);

if(flag==2 && data_num1==10 && E1_temp[10]==0xea)
{

//cli();
data_num0=1;
data_num1=1;
LCD_xy(0,1);//LCD指针坐标
write_asicc(2);
write_asicc(0);
GPS_date_time();//获取GPS时间
if((GPS_date_year/10)==0 && (GPS_date_year%10)==4)
{
write_asicc(GPS_date_year/10+0x30);
write_asicc(GPS_date_year%10+0x30+5);
}
else
{
write_asicc(GPS_date_year/10+0x30);
write_asicc(GPS_date_year%10+0x30);
}
write_hanzi(4);//年

write_asicc(GPS_date_month/10+0x30);
write_asicc(GPS_date_month%10+0x30);
write_hanzi(5);//月

write_asicc(GPS_date_day/10+0x30);
write_asicc(GPS_date_day%10+0x30);
write_hanzi(6);//日

LCD_xy(0,2);//LCD指针坐标
write_hanzi(2);//时
write_hanzi(3);//间
write_asicc(:);

write_asicc((GPS_time_hour+8)/10+0x30);
write_asicc((GPS_time_hour+8)%10+0x30);
write_asicc(:);

write_asicc(GPS_time_minute/10+0x30);
write_asicc(GPS_time_minute%10+0x30);
write_asicc(:);

write_asicc(GPS_time_second/10+0x30);
write_asicc(GPS_time_second%10+0x30);

///////////////////////////////////////////////
//////////卫星数量///////////
LCD_xy(0,7);//LCD指针坐标
write_asicc(S);
write_asicc(A);
write_asicc(T);
write_asicc(E);
write_asicc(L);
write_asicc(L);
write_asicc(I);
write_asicc(T);
write_asicc(E);
write_asicc(:);

if(E0_temp[21]>=0 && E0_temp[21]<=12){write_asicc(E0_temp[21]/10+0x30);write_asicc(E0_temp[21]%10+0x30); }
//////////////////////////////
////////海拔//////////////
LCD_xy(0,6);//LCD指针坐标

write_asicc(H);
write_asicc(I);
write_asicc(G);
write_asicc(H);
write_asicc(:);

Altitude_change();

// write_asicc(GPS_E0_temp[12]/10+0x30); //高3位不显示
// write_asicc(GPS_E0_temp[12]%10+0x30);
// write_asicc(GPS_E0_temp[13]/10+0x30);
if(GPS_Altitude<9000)
{
write_asicc( GPS_Altitude/1000+0x30);
write_asicc((GPS_Altitude%1000)/100+0x30);
write_asicc(((GPS_Altitude%1000)%100/10)+0x30);
write_asicc(.);
write_asicc(((GPS_Altitude%1000)%100%10)/10+0x30);
write_asicc(M);
flag=0;
}
else
{;}
//////////////////速度///////////////////

LCD_xy(1,5);//LCD指针坐标
write_asicc(S);
write_asicc(P);
write_asicc(E);
write_asicc(E);
write_asicc(D);
write_asicc(:);
Speed_change();
if(GPS_speed<9000)
{
write_asicc( GPS_speed/1000+0x30);
write_asicc((GPS_speed%1000)/100+0x30);
write_asicc(((GPS_speed%1000)%100/10)+0x30);
write_asicc(.);
write_asicc(((GPS_speed%1000)%100%10)/10+0x30);

}
else
{
write_asicc(0);
}

////////////////////经纬度///////////////////////////
LCD_xy(0,3);//LCD指针坐标
Coordinates_change(1);
write_asicc(N);

//////////////2009.12.29修改/////
if(GPS_degree!=34 && GPS_minute!=44)
{
/////////////////////////////////
if(GPS_degree>100){write_asicc(GPS_degree/100+0x30);write_asicc((GPS_degree%100)/10+0x30);write_asicc((GPS_degree%100)%10+0x30); write_asicc(23);}
if(GPS_degree<100){write_asicc(GPS_degree/10+0x30);write_asicc(GPS_degree%10+0x30);write_asicc(23);}
if(GPS_minute>100){write_asicc(GPS_minute/100+0x30);write_asicc((GPS_minute%100)/10+0x30);write_asicc((GPS_minute%100)%10+0x30); write_asicc(27);}
if(GPS_minute<100){write_asicc(GPS_minute/10+0x30);write_asicc(GPS_minute%10+0x30);write_asicc(27);}

if(GPS_second>100){write_asicc(GPS_second/100+0x30);write_asicc((GPS_second%100)/10+0x30);write_asicc((GPS_second%100)%10+0x30);}
if(GPS_second<100){write_asicc(GPS_second/10+0x30);write_asicc(GPS_second%10+0x30);}
if(GPS_last>100){write_asicc(GPS_last/100+0x30);write_asicc((GPS_last%100)/10+0x30);write_asicc((GPS_last%100)%10+0x30);}
if(GPS_last<100){write_asicc(GPS_last/10+0x30);write_asicc(GPS_last%10+0x30);}
}
else
{
write_asicc(0);write_asicc(0);write_asicc(23);write_asicc(0);write_asicc(0);write_asicc(27);write_asicc(0);write_asicc(0);write_asicc(0);write_asicc(0);write_asicc(0);
}

Copyright © 2017-2020 微波EDA网 版权所有

网站地图

Top