main() { TRISD.0 =1;TRISD.6=0; // khai báo 2 chân nhập xuất RD0=RD6=1; while(1) { if (!RD0) {delay_ms(10);while(!RD0);delay_ms(10);RD6=~RD6;} } }