2020-01-30 13:32发布
GANLOO 发表于 2008-7-11 11:17 //series_164_1.c #include unsigned char ii, ledk[17]={0x3f,0x06,0x5b,0x4f,0x66,0x6D,0x7d,0x07,0x7f, ...
最多设置5个标签!
#include <reg51.h>
unsigned char ii, ledk[17]={0x3f,0x06,0x5b,0x4f,0x66,0x6D,0x7d,0x07,0x7f,
0x6f,0x77,0x7c,0x39,0x5e,0x79,0x71,0x00};
void delay(unsigned int n)
{unsigned int i;
for(i=0;i<n;i++)
;}
unsigned char change_bit(unsigned char yy)
{unsigned char zz;
zz=((yy&0x80)>>7)|((yy&0x40)>>5)|((yy&0x20)>>3)|((yy&0x10)>>1)|
((yy&0x08)<<1)|((yy&0x04)<<3)|((yy&0x02)<<5)|((yy&0x01)<<7);
return zz;}
void s() interrupt 4
{TI=0;ii++;if(ii>9)ii=0;}
void main(void)
{unsigned char xx;
SCON=0x00;EA=1;ES=1;
while(1){xx=change_bit(ledk[ii]);
SBUF=xx;
delay(50000);}}
好 真心不错
一周热门 更多>