前言:
目前同学们对“数码管09显示”可能比较关切,同学们都想要学习一些“数码管09显示”的相关资讯。那么小编同时在网上网罗了一些关于“数码管09显示””的相关知识,希望小伙伴们能喜欢,咱们快快来学习一下吧!#include <reg51.h>
code unsigned char sz []={0xc0,0xf9,0xa4,0xb0,0x99,
0x92,0x82,0xf8,0x80,0x90};
void delay();
sbit P10=P1^0;
sbit sw0=P3^5;
sbit sw1=P3^6;
void main ()
{
char mun=0;
P10=0;
P0=sz[0];
while(1)
{
if (sw0==0)
{
delay();
if (sw0==0)
{
do
{
while (sw0==0);
delay();
}
while (sw0==0);
mun--;
if (mun<0) mun=0x09;
P0=sz [mun];
}
}
if (sw1==0)
{
delay();
if(sw1==0)
{
do
{
while(sw1==0);
delay();
}
while (sw1==0);
mun++;
if (mun>0x09) mun=0;
P0=sz [mun];
}
}
}
}
void delay()
{
unsigned int i;
i=10000;
while(i--);
}
标签: #数码管09显示