微波EDA网,见证研发工程师的成长!
首页 > 硬件设计 > 嵌入式设计 > PIC16F72单片机---NOKIA5110测试程序

PIC16F72单片机---NOKIA5110测试程序

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

////按键测试程序/
void keytest(void) //按键测试程序
{
if(KEY1==0)
{
LED1=!LED1;
while(KEY1==0) //按键去抖
{ delayms(100);}
}
/////////////////
if(KEY2==0)
{
LED2=!LED2;
while(KEY2==0) //按键去抖
{ delayms(100);}
}
////////////////
if(KEY3==0)
{
LED1=!LED1;
LED2=!LED2;
while(KEY3==0) //按键去抖
{ delayms(100);}
}
}

////////////主程序/////////////////////////
void main (void)
{
Init();//初始化程序
leddisplay();//LED显示程序
/* while(1)
{
keytest();

}*/
LCD_clear(); //LCD清屏
delayms(1000);
LCD_write_english_string(0,0,"Nokia5110 LCD" );
LCD_write_english_string(0,1,"MCU:PIC16F72 " );
LCD_write_english_string(0,2,"Version: V1.0" );
LCD_write_english_string(0,3,"Test OK! " );
LCD_write_english_string(0,4,"By ClimberWin" );
LCD_write_english_string(0,5,"2010.11.09 " );

while(1);
}

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

网站地图

Top