#include<reg52.h>
unsigned char code DM[]={0x00,0xff,0x02,0x04,0x08,0x10,0x20,0x40,0x80,0xfe,0xfc,
0xf8,0xf0,0x0f,0xe0,0xc0,0x80,0x7e,0xbd,0xdb,0xe7};
void delay(unsigned int a)
{
while(a--);
}
void main()
{
unsigned char i;
for(i=0;i<21;i++)
{
P1=DM[i];
delay(55535);
}
}
这是八路得的,你看着就会做了
追问感谢你的回答!22路能不能用查表法写啊?能举个例子么?
追答最好写个函数来实现