Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

ADC0809 C³ÌÐò

 #include<reg52.h>
#include<intrins.h>
#define uint  unsigned int
#define uchar unsigned char
uint date;
uchar mm=0,n=0;
uint k1,k2,k3,k4,k5,k6;
uchar code b[]={
    0x3f,0x06,0x5b,0x4f,0x66,   //0,1,2,3,4,
    0x6d,0x7d,0x07,0x7f,0x6f,   //5,6,7,8,9,C
    0xbf,0x86,0xdb,0xcf,0xe6,   //0.,1.,2.,3.,4.,
    0xed,0xfd,0x87,0xff,0xef,   //5.,6.,7.,8.,9.,
    };
sbit P20=P2^0;
sbit P21=P2^1;
sbit P22=P2^2;
sbit P27=P2^7;
sbit wr=P3^6;
sbit rd=P3^7;
sbit P32=P3^2;
void delay_10us(uchar n)    //10΢Ã뼶ÑÓʱ
{ do
  { _nop_();
    _nop_();
    _nop_();
    _nop_();
    _nop_();
  }while(--n);
}
void delay_ms(uint n)     //ºÁÃ뼶ÑÓʱ
{ do delay_10us(131);
  while(--n);
}
uchar adc0809()
{
 wr=0;
 _nop_();
 _nop_();
 wr=1;
  _nop_();
  _nop_();
 while(P32);
  rd=0;
  date=P0;
  delay_10us(10);
  rd=1;
  delay_ms(1000);
  date=date*19.607843;
  //date=date*(1000/51);
 n=0;
 k1=date/1000;//1
 k2=date%1000;//234
 k3=k2/100;//2
 k4=k2%100;//34
 k5=k4/10;//3
 k6=k4%10;//4
 if(n==0)
 {TI=0;
 SBUF=b[k6];
 while(!TI);
 TI=0;
 SBUF=b[k5];
 while(!TI);
 TI=0;
 SBUF=b[k3];
 while(!TI);
 TI=0;
 SBUF=b[k1+10];
 while(!TI);
 n=1;
}
}
void main()
{P0=0xff;
 P20=0;
 P21=0;
 P22=0;
 P27=0;
 while(1)
{
 adc0809();
}
}


Ïà¹ØÎĵµ£º

[zz] C/C++³ÌÐòԱӦƸ³£¼ûÃæÊÔÌâÉîÈëÆÊÎö £¨Ò»£©

 1.ÒýÑÔ ¡¡¡¡
      ±¾ÎĵÄд×÷Ä¿µÄ²¢²»ÔÚÓÚÌṩC/C++³ÌÐòÔ±ÇóÖ°ÃæÊÔÖ¸µ¼£¬¶øÖ¼ÔÚ´Ó¼¼ÊõÉÏ·ÖÎöÃæÊÔÌâµÄÄÚº­¡£ÎÄÖеĴó¶àÊýÃæÊÔÌâÀ´×Ô¸÷´óÂÛ̳£¬²¿·ÖÊÔÌâ½â´ðÒ²²Î¿¼ÁËÍøÓѵÄÒâ¼û¡£
      Ðí¶àÃæÊÔÌâ¿´ËƼòµ¥£¬È´ÐèÒªÉîºñµÄ»ù±¾¹¦²ÅÄܸø³öÍêÃÀµÄ½â´ð¡£ÆóÒµÒªÇóÃæÊÔ ......

C/C++±à³Ì¼¼ÄÜ¡¾ÕûÀí¡¿

Ô¤´¦ÀíÆ÷£¨Preprocessor£©
1. ÓÃÔ¤´¦ÀíÖ¸Áî#define ÉùÃ÷Ò»¸ö³£Êý£¬ÓÃÒÔ±íÃ÷1ÄêÖÐÓжàÉÙÃ루ºöÂÔÈòÄêÎÊÌ⣩
#define SECONDS_PER_YEAR (60 * 60 * 24 * 365)UL
ÎÒÔÚÕâÏë¿´µ½¼¸¼þÊÂÇ飺
1). #define Óï·¨µÄ»ù±¾ÖªÊ¶£¨ÀýÈ磺²»ÄÜÒԷֺŽáÊø£¬À¨ºÅµÄʹÓ㬵ȵȣ©
2). ¶®µÃÔ¤´¦ÀíÆ÷½«ÎªÄã¼ÆËã³£Êý±í´ïʽµÄÖµ£¬Òò´Ë£¬Ö±½Ó ......

ÔÚC++Öе÷ÓÃCдµÄº¯Êý£¨Ê¹ÓÃlex_yaccÓöµ½µÄÎÊÌâ)

ºÜÆæ¹Ö£¬ÒÔÇ°Ò»Ö±ÒÔΪC++ÊǼæÈÝCµÄ£¬µ«ÊÇ£¬½ñÌìÓÃlex&yaccÉú³ÉµÄC´úÂë¿ÉÓÃͨ¹ýGCCµÄ±àÒ룬
µ«ÊÇÔõô¶¼Í¨²»¹ýG++µÄ±àÒ룬¶øÆä´íÎóºÜ¶à£¬ÓпÉÄÜÊÇlex&yaccÉú³ÉµÄC´úÂëÌ«ÀÏÁË£¬£¬£¬
ÎÒÊÇÕâÑù½â¾öµÄ
°Ñlex&yaccÉú³ÉµÄ´úÂë Óà GCC -c ±àÒë³É lex.o µÄÄ¿±êÎļþ¡£È»ºó g++ main.cpp lex.o ,¾ÍOKÁË
¼ÇµÃ£º ÔÚ main. ......

extern "C"Ïê½â

       C++ÓïÑԵĴ´½¨³õÖÔÊÇ“a better
C”£¬µ«ÊÇÕâ²¢²»Òâζ×ÅC++ÖÐÀàËÆCÓïÑÔµÄÈ«¾Ö±äÁ¿ºÍº¯ÊýËù²ÉÓõıàÒëºÍÁ¬½Ó·½Ê½ÓëCÓïÑÔÍêÈ«Ïàͬ¡£×÷ΪһÖÖÓûÓëC¼æÈݵÄÓïÑÔ£¬C++±£ÁôÁËÒ»²¿·Ö¹ý³Ì
ʽÓïÑÔµÄÌص㣨±»ÊÀÈ˳ÆΪ“²»³¹µ×µØÃæÏò¶ÔÏ󔣩£¬Òò¶øËü¿ÉÒÔ¶¨Òå²»ÊôÓÚÈκÎÀàµÄ ......

ÃÀ¹úרÀû·¨Ìõ¿î102(c),102(d)

www.us-ip.com
ÃÀ¹úרÀû·¨Ìõ¿î102(c),102(d)
35 U.S.C. 102:
A person shall be entitled to a patent unless -
(c) he has abandoned the invention
102(c)Ìõ¿îÖ¸³öÈç¹û·¢Ã÷ÈËÒÅÆúÁË·¢Ã÷£¬ÄÇô·¢Ã÷È˽«²»ÄÜ»ñµÃÃÀ¹úרÀû¡£·¢Ã÷ÈËÒÅÆú·¢Ã÷±ØÐëÊǹÊÒâµÄÐÐΪ£¬²¢ÇÒÒâͼ½«ÒÅÆúµÄ·¢Ã÷·îÏ׸øÉç»á¡£·¢Ã÷È˲»Ò»¶¨ÐèÒª¹«¿ªÐûÊ¾Õ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ