»ùÓÚ51µ¥Æ¬»úµÄÓïÒô¼ÆËãÆ÷Éè¼Æ - ͼÎÄ

±±¾©ÁªºÏ´óѧ ±ÏÒµÉè¼Æ

lcden=1; }

void init() //³õʼ»¯ {

lcden=1; //ʹÄÜÐźÅΪ¸ßµçƽ write_com(0x38); //8룬2ÐÐ

write_com(0x0c); //ÏÔʾ¿ª£¬¹â±ê¹Ø£¬²»ÉÁ˸ write_com(0x06); //¹â±ê×óÒÆ£¬ÏÔʾÆÁ²»Òƶ¯ write_com(0x80); //¼ì²âæÐźŠwrite_com(0x01); //ÇåÆÁ i=0; j=0;

a=0; //µÚÒ»¸ö²ÎÓëÔËËãµÄÊý b=0; //µÚ¶þ¸ö²ÎÓëÔËËãµÄÊý c=0;

flag=0; //flag±íʾÊÇ·ñÓзûºÅ¼ü°´Ï£¬ fuhao=0; // fuhao±íÕ÷°´ÏµÄÊÇÄĸö·ûºÅ }

void INT_0(void) interrupt 0 using 0 {

temp=P2&0x0f; start=1; }

calculate() {

switch(temp) {

case 3: // ³ýºÅ write_date(0x30+table1[temp]); flag=1; fuhao=4;

43

±±¾©ÁªºÏ´óѧ ±ÏÒµÉè¼Æ

break;

case 7: // ³ËºÅ write_date(0x30+table1[temp]); flag=1; fuhao=3; break;

case 11: // ¼õºÅ write_date(0x30+table1[temp]); flag=1; fuhao=2; break;

case 12: // ON write_com(0x01); a=0; b=0; flag=0; fuhao=0; j=0; break;

case 14: // µÈºÅ { j=1; if(fuhao==1) {

write_com(0x80+0x4f); //°´ÏµÈÓÚ¼ü£¬¹â±êÇ°½øÖÁµÚ¶þÐÐ×îºóÒ»¸öÏÔʾ´¦ write_com(0x04); //ÉèÖôӺóסǰдÊý¾Ý£¬Ã¿Ð´ÍêÒ»¸öÊý¾Ý£¬¹â±êºó

ÍËÒ»¸ñ

c=a+b;

if(c>2147483647 || c<-2147483647)

{

44

ÁªÏµ¿Í·þ£º779662525#qq.com(#Ì滻Ϊ@)