求帮忙看下为什么这个LED流水灯跑不起来,谢谢

2019-07-15 15:20发布

图在这里,能点亮一个但是流水灯跑不起来,不知道是程序的问题还是电路的问题
QQ截图20151219172920.png
QQ截图20151219172933.png
友情提示: 此问题已得到解决,问题已经关闭,关闭后问题禁止继续编辑,回答。
19条回答
末影人
2019-07-17 02:06
别人的程序#include<reg52.h>
#include <intrins.h> //intrins.h库中含有循环移位函数  
#define uint unsigned int
#define uchar unsigned char
uchar temp; //定义全局变量temp
delay() //延时子函数
{
uint i,j;
for(i=1;i<400;i++)
for(j=1;j<400;j++);
}
void main() //主函数
{
temp=0xfe;
P0=temp;
while(1)
{
temp=_crol_(temp,1); //_crol_ 字符循环左移 _cror_ 字符循环右移 
delay();
P0=temp;
}
}

一周热门 更多>