当前位置:首页 > 技术学院 > 热搜器件
[导读]#include#define uint unsigned int#define uchar unsigned charuchar code table[]={0xc0,0xf9,0xa4,0xb0,0x99,0x92,0x82,0xf8,0x80,0x90,0x88,0x83,0xc6,0xa1,0x86,0x8e};sbit diola=P2^5;sbit dula=P2^6;sbit wel

#include

#define uint unsigned int

#define uchar unsigned char

uchar code table[]={0xc0,0xf9,0xa4,0xb0,0x99,0x92,0x82,0xf8,0x80,0x90,0x88,0x83,0xc6,0xa1,0x86,0x8e};

sbit diola=P2^5;

sbit dula=P2^6;

sbit wela=P2^7;

void Delay(uint x)

{

uchar i;

while(x--)

for(i=0;i<120;i++);

}

void main()

{

uchar i;

wela=0;

dula=0;

diola=1;

while(1)

{

for(i=0;i<10;i++)

{

wela=1;

P0=0x0f;

wela=0;

dula=1;

P0=table[i];

P1=table[i];

dula=0;

Delay(500);

}

}

}

本站声明: 本文章由作者或相关机构授权发布,目的在于传递更多信息,并不代表本站赞同其观点,本站亦不保证或承诺内容真实性等。需要转载请联系该专栏作者,如若文章内容侵犯您的权益,请及时联系本站删除( 邮箱:macysun@21ic.com )。
换一批
延伸阅读
关闭