这个我的测试程序流水灯:
#include<pic.h>
#define uint unsigned int
#define uchar unsigned char
__CONFIG(0x3B31);
void delay(uint z)
{
uint x,y;
for(x=z;x>0;x--)
for(y=110;y>0;y--);
}
void main()
{
TRISC=0;
PORTC=0;
while(1)
{
uint i;
PORTC=0X01;
for(i=8;i>0;i--)
{
delay(200);
PORTC=PORTC<<1;
}
}
}
9# shizaigaole
|