?? display.c
字號:
#include <_REG51_.H>
unsigned char code Tab[]={0x3F,0x06,0x5B,0x4F,0x66,0x6D,0x7D,0x07,
0x7F,0x6F,0x77,0x7C,0x39,0x5E,0x79,0x71};
sbit P20 = P2^0;
sbit P21 = P2^1;
//delay function
void Delay(uchar formal_t) //cost 6uS while rotate once.cost 11uS while called.[at 12MHz crystalloid]
{
uchar i;
i=formal_t;
while(i--){;}
}
//display function
void Display(uchar *p)
{
uchar i,p2tmp=0xfe;
for(i=0;i<8;i++)
{
P2=0xFF;
P0=Tab[*p];
P2=p2tmp;
Delay(5); //delay for 11+5*6=41uS.
p++;
p2tmp<<=1;
p2tmp|=0x01;
}
}
/*
void Delay (uchar formal_t);
void Display (uchar formal_dat);
*/
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -