單位共陽的數碼管,我是想靜態顯示0-9,間隔500ms,但是報錯了,一直沒有搞明白,我單個顯示單獨數字就可以。
坐等解答,感謝了
#include<reg52.h>
sbit p1_1=P1^0;
void delay(unsigned int z)
{
unsigned int x,y;
for(x=z;x>0;x--)
for(y=110;y>0,y--);
}
void main()
{
p1_1=1;
P3=0xff;
while(1)
{
P3=0xc0;
delay(500);
P3=0xF9;
delay(500);
P3=0xa4;
delay(500);
P3=0xb0;
delay(500);
P3=0x99;
}
}
Build target 'Target 1'
compiling lesson2-1
LESSON2-1 C(8): error C141: syntax error near ')'
Target not created
|