在单片机中一个端口貌似不能同时读写?
for(i =0;i<8;i++)
P0 = P0>>1;这句貌似不能正常运行。要必须加个中间变量 形如
unsigned char temp = 0x01;
for(i =0;i<8;i++)
{
temp = P0;
P0 = temp>>1;
}
这样后才能正常的左移动
在单片机中一个端口貌似不能同时读写?
for(i =0;i<8;i++)
P0 = P0>>1;这句貌似不能正常运行。要必须加个中间变量 形如
unsigned char temp = 0x01;
for(i =0;i<8;i++)
{
temp = P0;
P0 = temp>>1;
}
这样后才能正常的左移动