4*4¼üÅÌɨÃèC³ÌÐò
4*4¼üÅÌɨÃèC³ÌÐò
#include<reg52.h>
#define uchar unsigned char
uchar code table[]={0xC0,0xF9,0xA4,0xB0,0x99,
0x92,0x82,0xF8,0x80,0x90,
0x88,0x83,0xC6,0xA1,0x86,0x8E};
uchar temp,num;
void display(uchar);
void delay(uchar a)
{
uchar b;
for(;a>0;a--)
for(b=200;b>0;b--);
}
void main()
{
while(1)
{
P2=0x7f;
temp=P2;
temp&=0x0f;
if(temp!=0x0f)
{
delay(50);
if(temp!=0x0f)
{
switch(temp)
{
case 0x07: num="0"; break;
case 0x0b: num="1"; break;
case 0x0d: num="2"; break;
case 0x0e: num="3"; break;
}
}
}
P2=0xbf;
temp=P2;
temp&=0x0f;
if(temp!=0x0f)
{
delay(50);
if(temp!=0x0f)
{
switch(temp)
{
case 0x07: num="4"; break;
case 0x0b: num="5"; break;
case 0x0d: num="6"; break;
case 0x0e: num="7"; break;
}
}
}
P2=0xdf;
temp=P2;
temp&=0x0f;
if(temp!=0x0f)
{
delay(50);
if(temp!=0x0f)
{
switch(temp)
{
case 0x07: num="8"; break;
case 0x0b: num="9"; break;
case 0x0d: num="10"; break;
case 0x0e: num="11"; break;
}
}
}
P2=0xef;
temp=P2;
temp&=0x0f;
if(temp!=0x0f)
{
delay(50);
if(temp!=0x0f)
{
switch(temp)
{
&nb
Ïà¹ØÎĵµ£º
¸ñʽ: echo "\033[×Ö±³¾°ÑÕÉ«;×ÖÌåÑÕÉ«m×Ö·û´®\033[0m"
ÀýÈç:
echo "\033[41;36m something here \033[0m"
ÆäÖÐ41µÄλÖôú±íµ×É«, 36µÄλÖÃÊÇ´ú±í×ÖµÄÑÕÉ«
ÄÇЩascii code ÊǶÔÑÕÉ«µ÷ÓõÄʼĩ.
\033[ ; m …… \033[0m
×Ö±³¾°ÑÕÉ«·¶Î§:40----49
40:ºÚ
41:Éîºì
42:ÂÌ
43:»ÆÉ«
44:À¶É«
45:×ÏÉ«
4 ......
ÏîÄ¿ÖÐÒªÓõ½Ò»¸öÄ£¿é¡£¿´ÁËϸÃÄ£¿éµÄÓ÷¨£¬¾ÍÒÀºù«»Æ°µÄ°áµ½×Ô¼ºµÄ´úÂëÀïÃæÀ´ÁË¡£²»¹ýÔÚ±àÒëµÄʱºòÅöµ½ÁËÂé·³£¬ ÔÚ³ÌÐòÁ´½ÓµÄʱºò³ö´í£º“undefined reference to***",Ó¦¸ÃÊÇÒòΪûÓаüº¬ÏàÓ¦µÄ¿âÎļþ°É¡£
ÓÚÊDZȽÏÁËmake fileÎļþµÄд·¨£¬ÊÔͼÔÚÎÒÕâ±ß ......
2009-07-26 15:50
½ñÌìÇÞÊÒµÄɽ¶«ÐÖµÜÔÚÁ·¶þ¼¶µÄÉÏ»ú£¬ÆäÖÐÒ»¸öÌâÄ¿´ó¸ÅÊÇÕâÑù£ºÔÚÒ»¸öº¯ÊýÖУ¬ÓÐÒ»¸öÖ¸ÕëÐβΣ¬¼ÇΪ*p£¬È»ºóÔÚº¯ÊýÄÚ²¿¶¨ÒåÁËÁÙʱ±äÁ¿a,aºÍ*pÊÇͬÖÖÀàÐÍ¡£¾¹ýһϵÁмÆËã £¬aµÃµ½ÁËÒ»¸öÖµ£¬Õâ¸öÖµ×îºóÊÇÐèÒª¼Ç¼ÔÚÖ¸Õë*pÀïÃæµÄ£¬Ó¦¸ÃÔõô±£´æÄØ£¿ÎÒµ±Ê±Ëæ±ã¾Í˵£¬p=&a¡£½á¹û·¢Éú´íÎóÁË£¬Ã»Óе ......
ǰ¼¸Ìì²Î¼Óij¹«Ë¾µÄ±ÊÊÔ£¬ÓÐÒ»µÀÌâÊÇÓô¿CʵÏÖÒ»¸ö·ºÐͺ¯Êý¡£ÓôÃÆÁ˺þÃÓÃC++Ä£°åʵÏÖÁË¡£
ºêÓÐÈçϵÄÌØµã£º
1.ÓëconstÏà±È£¬ºêÊÇÔÚÔ¤±àÒëµÄʱºòÍê³ÉµÄ
2.define Ö»×ö¼òµ¥µÄÌæ»»£¬²»×öÀàÐͰ²È«¼ì²é
3.ʹÓò»µ±»áÒýÆðºÜ¶àÎÊÌâ
ºêµÄÓ÷¨£º
1.¼òµ¥µÄºê¶¨Òå
#define MAX 1024
2.ºê¶¨Ò幦ÄÜ¿é
#define MAX(a,b) ( ......