主程序:
#i nclude
void Delay1ms(unsigned int count)
{
unsigned int i,j;
for(i=0;i
}
main()
{
unsigned char LEDIndex = 0;
bit LEDDirection = 1;
while(1)
{
if(LEDDirection)
P1 = ~(0x01<
P1 = ~(0x80>>LEDIndex);
if(LEDIndex==7)
LEDDirection = !LEDDirection;
LEDIndex = (LEDIndex+1)%8;
Delay1ms(100);
}
}
本文关键字:程序 经验交流,电工技术 - 经验交流