求各位大神指教,初学C51程序,看哪儿错了,
#define uchar unsigned char
#define uint unsigned int
sbit wela=P2^7;
sbit dula=P2^3;
void delay(uint ms)
{
uint z,y;
while(ms--)
{
for(z=y;y>0;z--)
for(y=0;y>120;y++);
}
}
void main()
{
uchar z;
wela=1;
P0=0XC0;
wela=0;
while(1)
{
dula=0x3f;
for(z=0;z<4;z++)
{
dula=1;
P0=0x5b;
dula=0;
delay(250);
P0=P0>>2;
}
dula=0x5b;
for(z=0;z<4;z++)
{
dula=1;
dula=0x66;
dula=0;
delay(250);
for(z=0;z<4;z++);
P0=P0>>2;
}
}
}
#include<reg52.h>
#define uchar unsigned char
#define uint unsigned int
sbit wela=P2^7;
sbit dula=P2^3;
void delay(uint ms)
{
uint z,y;
while(ms--)
{
for(z=y;y>0;z--)
for(y=0;y>120;y++);
}
}
void main()
{
uchar z;
wela=1;
P0=0XC0;
wela=0;
while(1)
{
dula=0x3f;
for(z=0;z<4;z++)
{
dula=1;
P0=0x5b;
dula=0;
delay(250);
P0=P0>>2;
}
dula=0x5b;
for(z=0;z<4;z++)
{
dula=1;
dula=0x66;
dula=0;
delay(250);
for(z=0;z<4;z++);
P0=P0>>2;
}
}
}
sbit的信号不是只有0和1吗?