ARM7学习---GPS练习
Coordinates_change(2);
LCD_xy(0,4);//LCD指针坐标
write_asicc(E);
if(GPS_degree!=135 && GPS_minute!=21)
{
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);
}
flag=0;
// sei();
}
else
{;}
}
////////////主程序/////////////////////
int main(void)
{
unsigned char i,j,n,m;
uchar uart_temp;
uchar mode_flag;//模式标志位,用来切换界面
uchar tubiao1,tubiao2,tubiao3,tubiao4;//定义首界面图标
tubiao1=0x00;
tubiao2=0x00;
tubiao3=0x00;
tubiao4=0x00;
mode_flag=0x01;//模式标志位flag=0x00开机界面flag=0x01初始界面;flag=0x02日历界面;flag=0x03工具界面;
//flag=0x04导航界面;flag=0x05文件夹界面
delayms(50000);
flag=0;
gps_flag=0;//初始化
PLL_Init();//系统时钟配置,必须设置
PINSEL0 |= 0x00000005; //设置I/O连接到UART0
PINSEL1 |= 0x00000000;
UART0_INT(); //串口初始化
UART0_SendStr("LPC2103 UART0 Test OK!"); //向串口发送字符串
delayms(60000);
LCD_RCU6093_int(); //初始化液晶
LCD_xy(0,0);//LCD指针坐标
mode_flag=0x05;
while(1)
{
key1_flag=0x00;
key2_flag=0x00;
key3_flag=0x00;
LCD_RCU6093_int(); //初始化液晶
LCD_xy(0,0);//LCD指针坐标
da
///////////显示电池和信号强度////////////
LCD_xy(94,1);//LCD指针坐标
write_hanzi(19);//
LCD_xy(94,0);//LCD指针坐标
write_hanzi(17);//
LCD_xy(0,1);//LCD指针坐标
write_hanzi(20);//
LCD_xy(0,0);//LCD指针坐标
write_hanzi(24);//
////////////////////////////
LCD_xy(16,0);//LCD指针坐标
write_hanzi(7); //小
write_hanzi(8);// 文
write_hanzi(0); //电
write_hanzi(11);//子
write_asicc(0);//空白
write_asicc(0);//空白
write_asicc(G);
write_asicc(P);
write_asicc(S);
LCD_xy(0,7);//LCD指针坐标
write_asicc(O);
write_asicc(K);
LCD_xy(72,7);//LCD指针坐标
write_asicc(B);
write_asicc(A);
write_asicc(C);
write_asicc(K);
while(mode_flag==0x01)
{
//cli();
///////图标//////////////////////
write_hanzi16(0,2,3,tubiao1);
write_hanzi16(1,2*14+2,3,tubiao2);
write_hanzi16(2,4*14+2,3,tubiao3);
write_hanzi16(3,6*14+2,3,tubiao4);
//////////显示手持式导航仪/////////////////
write_hanzi16(4,4,5,0);
write_hanzi16(5,1*16+4,5,0);
write_hanzi16(6,2*16+4,5,0);
write_hanzi16(7,3*16+4,5,0);
write_hanzi16(8,4*16+4,5,0);
write_hanzi16(9,5*16+4,5,0);
keytest();
if( key1_flag==0){tubiao1=0;tubiao2=0;tubiao3=0;tubiao4=0;key2_flag=0;}
if( key1_flag==1){tubiao1=1;tubiao2=0;tubiao3=0;tubiao4=0;key2_flag=0;}
if( key1_flag==2){tubiao1=0;tubiao2=1;tubiao3=0;tubiao4=0;key2_flag=0;}
if( key1_flag==3){tubiao1=0;tubiao2=0;tubiao3=1;tubiao4=0;}
if( key1_flag==4){tubiao1=0;tubiao2=0;tubiao3=0;tubiao4=1;}
if( key1_flag==5){key1_flag=0;}
if( key1_flag==3 &&key2_flag==1){key2_flag=0;mode_flag=0x04;}
if( key1_flag==4 &&key2_flag==1){key2_flag=0;mode_flag=0x05;}
}
///////////////////////////////////////////////////////////////
while(mode_flag==0x04)
{
UART0_INT(); //串口初始化
//sei(); //中断使能(avr/interrupt.h 中调用)
LCD_RCU6093_Clear();
key3_flag=0;
gps_flag=0;
break;
}
while(mode_flag==0x04)
{
while(gps_flag==0)//如果GPS没收到指令就一直发送09.12.29
{
U0THR=0xc0;
delayms(10000);
U0THR=0xa3;
delayms(10000);
U0THR=0x8f;
delayms(10000);
U0THR=0xec;
delayms(10000);
U0THR=0xca;
delayms(50000);
LCD_xy(24,3);//LCD指针坐标
write_asicc(N);
write_asicc(O);
write_asicc(0);
write_asicc(G);
write_asicc(P);
write_asicc(S);
keytest();
if( key3_flag==1){key3_flag=0;mode_flag=0x01;break;}
}
while(1)
{
GPS_display();
keytest();
if( key3_flag==1){key3_flag=0;mode_flag=0x01;break;}
}
ARM7GP 相关文章:
- ARM7学习---GPIO笔记(11-18)
- Windows CE 进程、线程和内存管理(11-09)
- RedHatLinux新手入门教程(5)(11-12)
- uClinux介绍(11-09)
- openwebmailV1.60安装教学(11-12)
- Linux嵌入式系统开发平台选型探讨(11-09)