#include<reg52.h>
#define uchar unsigned char
#define uint unsigned int
uchar i;
void DelayMs(uint n)
{
uchar j;
while(n--)
for(j=0;j<113;j++);
}
void main()
{
while(1)
{
P1=0xfe;
DelayMs(500);
for(i=0;i<8;i++)
{
P1=~(~0xfe<<i);
DelayMs(500);
}
}
}左移动没有出现问题,但是右移动就与预期方式不同了,右移动该怎么实现呢,谢谢。
我要赚赏金
