#include "p18f458.h"
#define Button PORTBbits.RB0
#define Led PORTCbits.RC0
void delay()
{
unsigned char i,j;
for(i=0;i<255;i++)
for(j=0;j<255;j++)
;
}
void main()
{
TRISBbits.TRISB0=1;//B0输入
TRISCbits.TRISC0=0;//C0输出
Led=1;
while(1)
{
if(Button==0)
{
delay();
Led=~Led;
}
}
}